{"_id":"copy-to","_rev":"1145","name":"copy-to","description":"copy an object's properties to another object","dist-tags":{"latest":"2.0.1"},"maintainers":[{"name":"dead_horse","email":"dead_horse@qq.com"}],"time":{"modified":"2021-06-03T09:55:57.000Z","created":"2014-03-26T15:41:27.477Z","2.0.1":"2014-10-26T06:33:15.488Z","2.0.0":"2014-10-21T16:17:29.179Z","1.0.1":"2014-04-24T05:34:46.367Z","1.0.0":"2014-04-23T17:56:49.082Z","0.0.3":"2014-04-01T09:50:44.031Z","0.0.2":"2014-03-27T02:40:38.180Z","0.0.1":"2014-03-26T15:41:27.477Z"},"users":{"tunnckocore":true,"samhwang1990":true,"l3au":true,"qqqppp9998":true,"cwagner":true,"monjer":true,"brainpoint":true,"snowdream":true},"author":{"name":"dead_horse","email":"dead_horse@qq.com"},"repository":{"type":"git","url":"git://github.com/node-modules/copy-to.git"},"versions":{"2.0.1":{"name":"copy-to","version":"2.0.1","description":"copy an object's properties to another object","main":"index.js","files":["index.js"],"scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/node-modules/copy-to.git"},"keywords":["copy","object","properties","setter","getter"],"author":{"name":"dead_horse","email":"dead_horse@qq.com"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/copy-to/issues"},"homepage":"https://github.com/node-modules/copy-to","devDependencies":{"mocha":"*","should":"*"},"gitHead":"16cc01116fbb05e48ebf96e8e8f9b14cf2a4fba1","_id":"copy-to@2.0.1","_shasum":"2680fbb8068a48d08656b6098092bdafc906f4a5","_from":".","_npmVersion":"2.0.0-beta.3","_npmUser":{"name":"dead_horse","email":"dead_horse@qq.com"},"maintainers":[{"name":"dead_horse","email":"dead_horse@qq.com"}],"dist":{"shasum":"2680fbb8068a48d08656b6098092bdafc906f4a5","size":1718,"noattachment":false,"key":"/copy-to/-/copy-to-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/copy-to/download/copy-to-2.0.1.tgz"},"directories":{},"publish_time":1414305195488,"_cnpm_publish_time":1414305195488,"_hasShrinkwrap":false},"2.0.0":{"name":"copy-to","version":"2.0.0","description":"copy an object's properties to another object","main":"index.js","files":["index.js"],"scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/node-modules/copy-to.git"},"keywords":["copy","object","properties","setter","getter"],"author":{"name":"dead_horse","email":"dead_horse@qq.com"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/copy-to/issues"},"homepage":"https://github.com/node-modules/copy-to","devDependencies":{"mocha":"*","should":"*"},"gitHead":"a23a7c7856877d548b2341dda08b319c9ad60ff6","_id":"copy-to@2.0.0","_shasum":"86c67ae8670f662209c703befe2814cad9320b88","_from":".","_npmVersion":"2.0.0-beta.3","_npmUser":{"name":"dead_horse","email":"dead_horse@qq.com"},"maintainers":[{"name":"dead_horse","email":"dead_horse@qq.com"}],"dist":{"shasum":"86c67ae8670f662209c703befe2814cad9320b88","size":1679,"noattachment":false,"key":"/copy-to/-/copy-to-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/copy-to/download/copy-to-2.0.0.tgz"},"directories":{},"publish_time":1413908249179,"_cnpm_publish_time":1413908249179,"_hasShrinkwrap":false},"1.0.1":{"name":"copy-to","version":"1.0.1","description":"copy an object's properties to another object","main":"index.js","files":["index.js"],"scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/node-modules/copy-to.git"},"keywords":["copy","object","properties","setter","getter"],"author":{"name":"dead_horse","email":"dead_horse@qq.com"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/copy-to/issues"},"homepage":"https://github.com/node-modules/copy-to","devDependencies":{"mocha":"*","should":"*"},"_id":"copy-to@1.0.1","dist":{"shasum":"080e25e28206a2904633516781acca45efb081ca","size":1526,"noattachment":false,"key":"/copy-to/-/copy-to-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/copy-to/download/copy-to-1.0.1.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"dead_horse","email":"dead_horse@qq.com"},"maintainers":[{"name":"dead_horse","email":"dead_horse@qq.com"}],"directories":{},"publish_time":1398317686367,"_cnpm_publish_time":1398317686367,"_hasShrinkwrap":false},"1.0.0":{"name":"copy-to","version":"1.0.0","description":"copy an object's properties to another object","main":"index.js","files":["index.js"],"scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/node-modules/copy-to.git"},"keywords":["copy","object","properties","setter","getter"],"author":{"name":"dead_horse","email":"dead_horse@qq.com"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/copy-to/issues"},"homepage":"https://github.com/node-modules/copy-to","_id":"copy-to@1.0.0","dist":{"shasum":"272f8a2ad039b58284b2367cdca3be27842c04fb","size":1250,"noattachment":false,"key":"/copy-to/-/copy-to-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/copy-to/download/copy-to-1.0.0.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"dead_horse","email":"dead_horse@qq.com"},"maintainers":[{"name":"dead_horse","email":"dead_horse@qq.com"}],"directories":{},"publish_time":1398275809082,"_cnpm_publish_time":1398275809082,"_hasShrinkwrap":false},"0.0.3":{"name":"copy-to","version":"0.0.3","description":"copy an object's properties to another object","main":"index.js","files":["index.js"],"scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/dead-horse/copy-to.git"},"keywords":["copy","object","properties","setter","getter"],"author":{"name":"dead_horse","email":"dead_horse@qq.com"},"license":"MIT","bugs":{"url":"https://github.com/dead-horse/copy-to/issues"},"homepage":"https://github.com/dead-horse/copy-to","_id":"copy-to@0.0.3","dist":{"shasum":"1643f8f8b6270a50e641aca1fb570aa214d5bcd7","size":1229,"noattachment":false,"key":"/copy-to/-/copy-to-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/copy-to/download/copy-to-0.0.3.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"dead_horse","email":"dead_horse@qq.com"},"maintainers":[{"name":"dead_horse","email":"dead_horse@qq.com"}],"directories":{},"publish_time":1396345844031,"_cnpm_publish_time":1396345844031,"_hasShrinkwrap":false},"0.0.2":{"name":"copy-to","version":"0.0.2","description":"copy an object's properties to another object","main":"index.js","files":["index.js"],"scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/dead-horse/copy-to.git"},"keywords":["copy","object","properties","setter","getter"],"author":{"name":"dead_horse","email":"dead_horse@qq.com"},"license":"MIT","bugs":{"url":"https://github.com/dead-horse/copy-to/issues"},"homepage":"https://github.com/dead-horse/copy-to","_id":"copy-to@0.0.2","dist":{"shasum":"4c82fda6a679febe2fe8c725ba07b2e2841327e0","size":1209,"noattachment":false,"key":"/copy-to/-/copy-to-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/copy-to/download/copy-to-0.0.2.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"dead_horse","email":"dead_horse@qq.com"},"maintainers":[{"name":"dead_horse","email":"dead_horse@qq.com"}],"directories":{},"publish_time":1395888038180,"_cnpm_publish_time":1395888038180,"_hasShrinkwrap":false},"0.0.1":{"name":"copy-to","version":"0.0.1","description":"copy an object's properties to another object","main":"index.js","files":["index.js"],"scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/dead-horse/copy-to.git"},"keywords":["copy","object","properties","setter","getter"],"author":{"name":"dead_horse","email":"dead_horse@qq.com"},"license":"MIT","bugs":{"url":"https://github.com/dead-horse/copy-to/issues"},"homepage":"https://github.com/dead-horse/copy-to","_id":"copy-to@0.0.1","dist":{"shasum":"8535574f1e5302995299996b260b32b2b47145ff","size":1116,"noattachment":false,"key":"/copy-to/-/copy-to-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/copy-to/download/copy-to-0.0.1.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"dead_horse","email":"dead_horse@qq.com"},"maintainers":[{"name":"dead_horse","email":"dead_horse@qq.com"}],"directories":{},"publish_time":1395848487477,"_cnpm_publish_time":1395848487477,"_hasShrinkwrap":false}},"readme":"copy-to\n=======\n\n[![Build Status](https://travis-ci.org/node-modules/copy-to.svg?branch=master)](https://travis-ci.org/node-modules/copy-to)\n\ncopy an object's properties to another one, include propertiy, getter and setter.\n\n## Install\n\n```\nnpm install copy-to\n```\n\n## Usage\n\n```js\ncopy(src).to(des);\ncopy(src).toCover(des);\ncopy(src).override(des);\n\ncopy(src).pick('proName1', 'proName2').to(des);\ncopy(src).pick('proName1', 'proName2').toCover(des);\ncopy(src).pick('proName1', 'proName2').override(des);\n\ncopy(src).and(other).to(des);\ncopy(src).and(other).toCover(des);\ncopy(src).and(second).and(third).to(des);\n\ncopy(src).and(other).pick('proName1', 'proName2').to(des);\ncopy(src).and(other).pick('proName1', 'proName2').toCover(des);\ncopy(src).and(second).and(third).pick('proName1', 'proName2').to(des);\n```\n\nIt won't copy access(getter / setter) by default, if you want to copy them, please use:\n\n```js\ncopy(src).withAccess().and(other).to(des);\n```\n\n## Example\n\n```js\nvar copy = require('copy-to');\n\nvar src = {\n  _name: 'foo',\n  set name(val) {\n    this._name = val;\n  },\n  get name() {\n    return this._name;\n  },\n  show: function () {\n    console.log(this._name);\n  }\n};\n\nvar des = {\n  _name: 'bar'\n};\n\ncopy(src).to(des);\ncopy(src).toCover(des);\ncopy(src).pick('_name', 'name').to(des);\ncopy(src).pick('_name', 'name').toCover(des);\n```\n\n## License\nMIT\n","_attachments":{},"homepage":"https://github.com/node-modules/copy-to","bugs":{"url":"https://github.com/node-modules/copy-to/issues"},"license":"MIT"}