{"_id":"predefine","_rev":"363605","name":"predefine","description":"Predefine your Object.defineProperties to create a more human readable API.","dist-tags":{"latest":"0.1.2"},"maintainers":[{"name":"3rdeden","email":"npm@3rd-Eden.com"},{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":"jcrugzz@gmail.com"},{"name":"v1","email":"info@3rd-Eden.com"}],"time":{"modified":"2021-07-13T08:59:59.000Z","created":"2014-01-04T20:42:41.177Z","0.1.2":"2014-10-28T15:41:35.697Z","0.1.1":"2014-03-25T16:12:38.943Z","0.1.0":"2014-03-25T15:47:54.938Z","0.0.6":"2014-03-25T15:46:20.419Z","0.0.5":"2014-03-25T15:22:56.319Z","0.0.3":"2014-03-18T22:58:10.894Z","0.0.2":"2014-02-14T11:43:57.549Z","0.0.1":"2014-01-06T12:02:22.386Z","0.0.0":"2014-01-04T20:42:41.177Z"},"users":{"servel333":true},"author":{"name":"Arnout Kazemier"},"repository":{"type":"git","url":"git://github.com/bigpipe/predefine.git"},"versions":{"0.1.2":{"name":"predefine","version":"0.1.2","description":"Predefine your Object.defineProperties to create a more human readable API.","main":"index.js","scripts":{"test":"mocha $(find test -name '*.test.js')"},"repository":{"type":"git","url":"git://github.com/bigpipe/predefine.git"},"keywords":["predefine","define","object","defineProperties","defineProperties","configurable","writable","get","set","getters","setters","inherit"],"author":{"name":"Arnout Kazemier"},"license":"MIT","dependencies":{"extendible":"0.1.x"},"devDependencies":{"pre-commit":"0.0.x","mocha":"1.16.x","chai":"1.8.x"},"gitHead":"7bd07970932ae612b0dcdafd5f880c5375215dd9","bugs":{"url":"https://github.com/bigpipe/predefine/issues"},"homepage":"https://github.com/bigpipe/predefine","_id":"predefine@0.1.2","_shasum":"2aa92b4496bc1f8554e43a45f76bfbe50d33d37f","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"V1","email":"info@3rd-Eden.com"},"maintainers":[{"name":"3rdeden","email":"npm@3rd-Eden.com"},{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":"jcrugzz@gmail.com"},{"name":"v1","email":"info@3rd-Eden.com"}],"dist":{"shasum":"2aa92b4496bc1f8554e43a45f76bfbe50d33d37f","size":5119,"noattachment":false,"key":"/predefine/-/predefine-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/predefine/download/predefine-0.1.2.tgz"},"directories":{},"publish_time":1414510895697,"_cnpm_publish_time":1414510895697,"_hasShrinkwrap":false},"0.1.1":{"name":"predefine","version":"0.1.1","description":"Predefine your Object.defineProperties to create a more human readable API.","main":"index.js","scripts":{"test":"mocha $(find test -name '*.test.js')"},"repository":{"type":"git","url":"git://github.com/bigpipe/predefine.git"},"keywords":["predefine","define","object","defineProperties","defineProperties","configurable","writable","get","set","getters","setters","inherit"],"author":{"name":"Arnout Kazemier"},"license":"MIT","dependencies":{"extendable":"0.0.x"},"devDependencies":{"pre-commit":"0.0.x","mocha":"1.16.x","chai":"1.8.x"},"bugs":{"url":"https://github.com/bigpipe/predefine/issues"},"homepage":"https://github.com/bigpipe/predefine","_id":"predefine@0.1.1","dist":{"shasum":"bdea730b530a5400a28e050fb192443c9f82da75","size":5144,"noattachment":false,"key":"/predefine/-/predefine-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/predefine/download/predefine-0.1.1.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"V1","email":"info@3rd-Eden.com"},"maintainers":[{"name":"3rdeden","email":"npm@3rd-Eden.com"},{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":"jcrugzz@gmail.com"},{"name":"v1","email":"info@3rd-Eden.com"}],"directories":{},"publish_time":1395763958943,"_cnpm_publish_time":1395763958943,"_hasShrinkwrap":false},"0.1.0":{"name":"predefine","version":"0.1.0","description":"Predefine your Object.defineProperties to create a more human readable API.","main":"index.js","scripts":{"test":"mocha $(find test -name '*.test.js')"},"repository":{"type":"git","url":"git://github.com/bigpipe/predefine.git"},"keywords":["predefine","define","object","defineProperties","defineProperties","configurable","writable","get","set","getters","setters","inherit"],"author":{"name":"Arnout Kazemier"},"license":"MIT","dependencies":{"extendable":"0.0.x"},"devDependencies":{"pre-commit":"0.0.x","mocha":"1.16.x","chai":"1.8.x"},"bugs":{"url":"https://github.com/bigpipe/predefine/issues"},"homepage":"https://github.com/bigpipe/predefine","_id":"predefine@0.1.0","dist":{"shasum":"2b7c2a37fb172baa1247899c30290ce80b07f0c4","size":5058,"noattachment":false,"key":"/predefine/-/predefine-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/predefine/download/predefine-0.1.0.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"V1","email":"info@3rd-Eden.com"},"maintainers":[{"name":"3rdeden","email":"npm@3rd-Eden.com"},{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":"jcrugzz@gmail.com"},{"name":"v1","email":"info@3rd-Eden.com"}],"directories":{},"publish_time":1395762474938,"_cnpm_publish_time":1395762474938,"_hasShrinkwrap":false},"0.0.6":{"name":"predefine","version":"0.0.6","description":"Predefine your Object.defineProperties to create a more human readable API.","main":"index.js","scripts":{"test":"mocha $(find test -name '*.test.js')"},"repository":{"type":"git","url":"git://github.com/bigpipe/predefine.git"},"keywords":["predefine","define","object","defineProperties","defineProperties","configurable","writable","get","set","getters","setters","inherit"],"author":{"name":"Arnout Kazemier"},"license":"MIT","dependencies":{"extendable":"0.0.x"},"devDependencies":{"pre-commit":"0.0.x","mocha":"1.16.x","chai":"1.8.x"},"bugs":{"url":"https://github.com/bigpipe/predefine/issues"},"homepage":"https://github.com/bigpipe/predefine","_id":"predefine@0.0.6","dist":{"shasum":"b057cc5874bca8c91611d86a3d368c1d1d9822d4","size":4634,"noattachment":false,"key":"/predefine/-/predefine-0.0.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/predefine/download/predefine-0.0.6.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"V1","email":"info@3rd-Eden.com"},"maintainers":[{"name":"3rdeden","email":"npm@3rd-Eden.com"},{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":"jcrugzz@gmail.com"},{"name":"v1","email":"info@3rd-Eden.com"}],"directories":{},"publish_time":1395762380419,"_cnpm_publish_time":1395762380419,"_hasShrinkwrap":false},"0.0.5":{"name":"predefine","version":"0.0.5","description":"Predefine your Object.defineProperties to create a more human readable API.","main":"index.js","scripts":{"test":"mocha $(find test -name '*.test.js')"},"repository":{"type":"git","url":"git://github.com/bigpipe/predefine.git"},"keywords":["predefine","define","object","defineProperties","defineProperties","configurable","writable","get","set","getters","setters","inherit"],"author":{"name":"Arnout Kazemier"},"license":"MIT","dependencies":{"extendable":"0.0.x"},"devDependencies":{"pre-commit":"0.0.x","mocha":"1.16.x","chai":"1.8.x"},"bugs":{"url":"https://github.com/bigpipe/predefine/issues"},"homepage":"https://github.com/bigpipe/predefine","_id":"predefine@0.0.5","dist":{"shasum":"effcb34834f5679883a25f8f3ff2ad732e4f5716","size":5063,"noattachment":false,"key":"/predefine/-/predefine-0.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/predefine/download/predefine-0.0.5.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"V1","email":"info@3rd-Eden.com"},"maintainers":[{"name":"3rdeden","email":"npm@3rd-Eden.com"},{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":"jcrugzz@gmail.com"},{"name":"v1","email":"info@3rd-Eden.com"}],"directories":{},"publish_time":1395760976319,"_cnpm_publish_time":1395760976319,"_hasShrinkwrap":false},"0.0.3":{"name":"predefine","version":"0.0.3","description":"Predefine your Object.defineProperties to create a more human readable API.","main":"index.js","scripts":{"test":"mocha $(find test -name '*.test.js')"},"repository":{"type":"git","url":"git://github.com/bigpipe/predefine.git"},"keywords":["predefine","define","object","defineProperties","defineProperties","configurable","writable","get","set","getters","setters","inherit"],"author":{"name":"Arnout Kazemier"},"license":"MIT","dependencies":{"extendable":"0.0.x"},"devDependencies":{"pre-commit":"0.0.x","mocha":"1.16.x","chai":"1.8.x"},"bugs":{"url":"https://github.com/bigpipe/predefine/issues"},"homepage":"https://github.com/bigpipe/predefine","_id":"predefine@0.0.3","dist":{"shasum":"1cf9d6b2fb0109fdb1a0cc8a440ea06e7535b1d6","size":4660,"noattachment":false,"key":"/predefine/-/predefine-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/predefine/download/predefine-0.0.3.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"V1","email":"info@3rd-Eden.com"},"maintainers":[{"name":"3rdeden","email":"npm@3rd-Eden.com"},{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":"jcrugzz@gmail.com"},{"name":"v1","email":"info@3rd-Eden.com"}],"directories":{},"publish_time":1395183490894,"_cnpm_publish_time":1395183490894,"_hasShrinkwrap":false},"0.0.2":{"name":"predefine","version":"0.0.2","description":"Predefine your Object.defineProperties to create a more human readable API.","main":"index.js","scripts":{"test":"mocha $(find test -name '*.test.js')"},"keywords":["predefine","define","object","defineProperties","defineProperties","configurable","writable","get","set","getters","setters","inherit"],"author":{"name":"Arnout Kazemier"},"license":"MIT","dependencies":{"extendable":"0.0.x"},"devDependencies":{"pre-commit":"0.0.x","mocha":"1.16.x","chai":"1.8.x"},"_id":"predefine@0.0.2","dist":{"shasum":"b1779e61dddd424cd7ef9b0eb584aace29f6305d","size":4492,"noattachment":false,"key":"/predefine/-/predefine-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/predefine/download/predefine-0.0.2.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"V1","email":"info@3rd-Eden.com"},"maintainers":[{"name":"3rdeden","email":"npm@3rd-Eden.com"},{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":"jcrugzz@gmail.com"},{"name":"v1","email":"info@3rd-Eden.com"}],"directories":{},"publish_time":1392378237549,"_cnpm_publish_time":1392378237549,"_hasShrinkwrap":false},"0.0.1":{"name":"predefine","version":"0.0.1","description":"Predefine your Object.defineProperties to create a more human readable API.","main":"index.js","scripts":{"test":"mocha $(find test -name '*.test.js')"},"keywords":["predefine","define","object","defineProperties","defineProperties","configurable","writable","get","set","getters","setters","inherit"],"author":{"name":"Arnout Kazemier"},"license":"MIT","dependencies":{"extendable":"0.0.x"},"devDependencies":{"pre-commit":"0.0.x","mocha":"1.16.x","chai":"1.8.x"},"readmeFilename":"README.md","_id":"predefine@0.0.1","dist":{"shasum":"9dcf45ff1ef23e396d24398126c3a6eb52fc75a7","size":4261,"noattachment":false,"key":"/predefine/-/predefine-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/predefine/download/predefine-0.0.1.tgz"},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"V1","email":"info@3rd-Eden.com"},"maintainers":[{"name":"3rdeden","email":"npm@3rd-Eden.com"},{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":"jcrugzz@gmail.com"},{"name":"v1","email":"info@3rd-Eden.com"}],"directories":{},"publish_time":1389009742386,"_cnpm_publish_time":1389009742386,"_hasShrinkwrap":false},"0.0.0":{"name":"predefine","version":"0.0.0","description":"Predefine your Object.defineProperties to create a more human readable API.","main":"index.js","scripts":{"test":"mocha $(find test -name '*.test.js')"},"keywords":["predefine","define","object","defineProperties","defineProperties","configurable","writable","get","set","getters","setters","inherit"],"author":{"name":"Arnout Kazemier"},"license":"MIT","dependencies":{"extendable":"0.0.x","chai":"1.8.x"},"devDependencies":{"pre-commit":"0.0.x","mocha":"1.16.x"},"readmeFilename":"README.md","_id":"predefine@0.0.0","dist":{"shasum":"18be036b879beedb390cdb4be25d9c5b568e8f6c","size":3430,"noattachment":false,"key":"/predefine/-/predefine-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/predefine/download/predefine-0.0.0.tgz"},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"V1","email":"info@3rd-Eden.com"},"maintainers":[{"name":"3rdeden","email":"npm@3rd-Eden.com"},{"name":"indexzero","email":"charlie.robbins@gmail.com"},{"name":"jcrugzz","email":"jcrugzz@gmail.com"},{"name":"v1","email":"info@3rd-Eden.com"}],"directories":{},"publish_time":1388868161177,"_cnpm_publish_time":1388868161177,"_hasShrinkwrap":false}},"readme":"# predefine\n\n[![Build Status](https://travis-ci.org/bigpipe/predefine.png)](https://travis-ci.org/bigpipe/predefine)\n\nWhen creating objects or prototypes using `Object.defineProperties` or\n`Object.defineProperty` it make your code look really verbose by all the\nproperty descriptions that it needs. Most of the time, they are the same. They\neither make your properties writable, readable or prevents them from being\nenumerable. So basically:\n\nPredefine makes `Object.defineProperties` your human readable and manageable.\n\n## Installation\n\n```\nnpm install --save predefine\n```\n\n## Getting started\n\nLet's start with a basic example of predefine usage:\n\n```\nvar predefine = require('predefine');\n\nfunction Base() {\n  var readable = predefine(this, { configurable: false, enumerable: false })\n    , writable = predefine(this, predefine.WRITABLE);\n\n  readable('prop', 'value');\n  writable('data', []);\n}\n\nBase.writable = predefine(Base.prototype, predefine.WRITABLE);\n\nBase.writable('foo', 'bar');\n```\n\nAs you can see from the snippet above, it's really easy to see which properties\nare made readable and which one's are writable.\n\n### Predefine.extend\n\nThis allows you to add `Backbone` inspired `.extend` functionality to your\nconstructors. This makes inheriting a lot easier and readable. See the\n`extendible` module in npm for information.\n\n```js\nfunction Foo() {}\nFoo.extend = predefine.extend;\n\nvar Bar = Foo.extend({\n  method: function () {}\n});\n```\n\n### Predefine.descriptor\n\nTest if a given object is a valid `Object` description to it can be used with\n`Object.defineProperty`, `Object.defineProperties` and `Object.create`.\n\n```js\npredefine.descriptor({ foo: 'bar' });                       // false\npredefine.descriptor({ value: 'bar' });                     // true\npredefine.descriptor({ value: 'bar', enumerable: false });  // true\npredefine.descriptor({ value: 'bar', foo: 'bar' });         // false\n```\n\n### Predefine.create\n\nThis is a simple helper function to create descriptions that can be used within\n`Object.create` and `Object.defineProperties`.\n\n```js\nvar data = Object.create(null, predefine.create('foo', { \n  value: 'bar' \n}));\n\nvar data = Object.create(null, predefine.create('foo', {\n  value: 'bar'\n}, predefine.READABLE));\n\nvar data = Object.create(null, predefine.create('foo', 'bar', predefine.READABLE));\n```\n\n### Predefine.remove\n\nRemoves all enumerable properties from a given object, with the ability to keep\nwhite listed properties.\n\n```js\nvar data = { foo: 'bar', bar: 'foo' };\n\npredefine.remove(data);           // The data variable is now an empty object.\npredefine.remove(data, ['foo']);  // The foo property is kept.\n\nvar readable(data);\nreadable('baz', 'baz');\n\npredefine.remove(data);           // Only `baz` is left.\n```\n\n### Predefine.merge\n\nMerge two objects in to one single object. This supports deep merging.\n\n```js\nvar result = predefine.merge({ foo: 'bar' }, { bar: 'foo' });\n```\n\n### Predefine.mixin\n\nMixin two Objects, which also transfers properties that are set using\nObject.defineProperty.\n\n```js\nvar result = predefine.mixin({ foo: 'bar' }, { bar: 'foo' });\n```\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/bigpipe/predefine","bugs":{"url":"https://github.com/bigpipe/predefine/issues"},"license":"MIT"}