{"_id":"describe-property","_rev":"198496","name":"describe-property","description":"Define JavaScript object properties quickly with ES5 defaults","dist-tags":{"latest":"1.1.0"},"maintainers":[{"name":"mjackson","email":"npm@mjackson.me"}],"time":{"modified":"2023-03-20T08:12:26.000Z","created":"2015-01-01T19:04:41.608Z","1.1.0":"2015-01-19T04:39:02.792Z","1.0.1":"2015-01-02T02:21:41.352Z","1.0.0":"2015-01-01T19:04:41.608Z"},"users":{},"author":{"name":"Michael Jackson"},"repository":{"type":"git","url":"https://github.com/mjackson/describe-property"},"versions":{"1.1.0":{"name":"describe-property","version":"1.1.0","description":"Define JavaScript object properties quickly with ES5 defaults","main":"index.js","scripts":{"test":"jshint . && mocha --reporter spec 'tests/*-test.js'"},"repository":{"type":"git","url":"https://github.com/mjackson/describe-property"},"keywords":["property","properties","defineProperty","defineProperties"],"author":{"name":"Michael Jackson"},"license":"MIT","bugs":{"url":"https://github.com/mjackson/describe-property/issues"},"homepage":"https://github.com/mjackson/describe-property","dependencies":{"object-assign":"^2.0.0"},"devDependencies":{"expect":"^1.3.0","jshint":"^2.5.11","mocha":"^2.1.0"},"gitHead":"56c6480116667a6b2dd51859c54278d804c23e0d","_id":"describe-property@1.1.0","_shasum":"bef31540227b51fe691b0c758f873d95b1b286d0","_from":".","_npmVersion":"2.1.17","_nodeVersion":"0.10.28","_npmUser":{"name":"mjackson","email":"mjijackson@gmail.com"},"maintainers":[{"name":"mjackson","email":"npm@mjackson.me"}],"dist":{"shasum":"bef31540227b51fe691b0c758f873d95b1b286d0","size":1796,"noattachment":false,"key":"/describe-property/-/describe-property-1.1.0.tgz","tarball":"http://name.csiicloud.com:7001/describe-property/download/describe-property-1.1.0.tgz"},"directories":{},"publish_time":1421642342792,"_hasShrinkwrap":false,"_cnpm_publish_time":1421642342792,"_cnpmcore_publish_time":"2021-12-16T18:18:51.993Z"},"1.0.1":{"name":"describe-property","version":"1.0.1","description":"Define JavaScript object properties quickly with ES5 defaults","main":"modules/describeProperty.js","scripts":{"test":"jshint . && mocha --reporter spec 'modules/**/__tests__/*-test.js'"},"repository":{"type":"git","url":"https://github.com/mjackson/describe-property"},"keywords":["property","properties","defineProperty","defineProperties"],"author":{"name":"Michael Jackson"},"license":"MIT","bugs":{"url":"https://github.com/mjackson/describe-property/issues"},"homepage":"https://github.com/mjackson/describe-property","dependencies":{"object-assign":"^2.0.0"},"devDependencies":{"expect":"^1.3.0","jshint":"^2.5.11","mocha":"^2.1.0"},"gitHead":"7473b7a472a872e7544a91432060122f4dd217be","_id":"describe-property@1.0.1","_shasum":"ff404c1155b2a3958726cd3b10c7b6213408da59","_from":".","_npmVersion":"2.1.17","_nodeVersion":"0.10.28","_npmUser":{"name":"mjackson","email":"mjijackson@gmail.com"},"maintainers":[{"name":"mjackson","email":"npm@mjackson.me"}],"dist":{"shasum":"ff404c1155b2a3958726cd3b10c7b6213408da59","size":1797,"noattachment":false,"key":"/describe-property/-/describe-property-1.0.1.tgz","tarball":"http://name.csiicloud.com:7001/describe-property/download/describe-property-1.0.1.tgz"},"directories":{},"publish_time":1420165301352,"_hasShrinkwrap":false,"_cnpm_publish_time":1420165301352,"_cnpmcore_publish_time":"2021-12-16T18:18:52.426Z"},"1.0.0":{"name":"describe-property","version":"1.0.0","description":"Define JavaScript object properties quickly with ES5 defaults","main":"modules/describeProperty.js","scripts":{"test":"jshint . && mocha --reporter spec 'modules/**/__tests__/*-test.js'"},"repository":{"type":"git","url":"https://github.com/mjackson/describe-property"},"keywords":["property","properties","defineProperty","defineProperties"],"author":{"name":"Michael Jackson"},"license":"MIT","bugs":{"url":"https://github.com/mjackson/describe-property/issues"},"homepage":"https://github.com/mjackson/describe-property","dependencies":{"object-assign":"^2.0.0"},"devDependencies":{"expect":"^1.3.0","jshint":"^2.5.11","mocha":"^2.1.0"},"gitHead":"8721ac50c930336fce72631280152836455489e7","_id":"describe-property@1.0.0","_shasum":"4654d0650dc6dd918de11e5722483db67a5ed746","_from":".","_npmVersion":"2.1.17","_nodeVersion":"0.10.28","_npmUser":{"name":"mjackson","email":"mjijackson@gmail.com"},"maintainers":[{"name":"mjackson","email":"npm@mjackson.me"}],"dist":{"shasum":"4654d0650dc6dd918de11e5722483db67a5ed746","size":2077,"noattachment":false,"key":"/describe-property/-/describe-property-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/describe-property/download/describe-property-1.0.0.tgz"},"directories":{},"publish_time":1420139081608,"_hasShrinkwrap":false,"_cnpm_publish_time":1420139081608,"_cnpmcore_publish_time":"2021-12-16T18:18:52.630Z"}},"readme":"[![npm package](https://img.shields.io/npm/v/describe-property.svg?style=flat-square)](https://www.npmjs.org/package/describe-property)\n[![build status](https://img.shields.io/travis/mjackson/describe-property.svg?style=flat-square)](https://travis-ci.org/mjackson/describe-property)\n[![dependency status](https://img.shields.io/david/mjackson/describe-property.svg?style=flat-square)](https://david-dm.org/mjackson/describe-property)\n[![code climate](https://img.shields.io/codeclimate/github/mjackson/describe-property.svg?style=flat-square)](https://codeclimate.com/github/mjackson/describe-property)\n\n[describe-property](https://github.com/mjackson/describe-property) is a property descriptor library that runs in both node.js and the browser. You use it to quickly generate property descriptors to use with [`Object.create`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create), [`Object.defineProperty`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty), and/or [`Object.defineProperties`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperties).\n\n### Example\n\n```js\nvar d = require('describe-property');\n\nfunction Person(firstName, surname) {\n  this.firstName = firstName;\n  this.surname = surname;\n}\n\nObject.defineProperties(Person.prototype, {\n\n  // Methods can be passed directly.\n  sayHi: d(function () {\n    console.log('Hello, my name is', this.fullName);\n  }),\n\n  // Getters are defined using d.gs.\n  fullName: d.gs(function () {\n    return this.firstName + ' ' + this.surname;\n  }),\n\n  // Setters are defined as the second argument to d.gs.\n  firstName: d.gs(function () {\n    return this._firstName;\n  }, function (value) {\n    this._firstName = value.trim();\n  })\n\n});\n```\n\nBy default property descriptors use ES5 attributes.\n\n```js\n{\n  configurable: true,\n  enumerable: false,\n  writable: true\n}\n```\n\nBut any of these can be overridden using an object literal.\n\n```js\nd({\n  enumerable: true,\n  value: function () {\n    // ...\n  }\n}); // => { configurable: true, enumerable: true, writable: true, value: function () {} }\n```\n\n### Installation\n\nUsing [npm](https://www.npmjs.org/):\n\n    $ npm install describe-property\n\n### Issues\n\nPlease file issues on the [issue tracker on GitHub](https://github.com/mjackson/describe-property/issues).\n\n### Tests\n\nTo run the tests in node:\n\n    $ npm install\n    $ npm test\n\n### Credits\n\nThis library was inspired by [@medikoo](https://github.com/medikoo)'s excellent [d](https://github.com/medikoo/d) library. It is intended to be a lighter-weight alternative with fewer features, but also only a single dependency.\n\n### License\n\n[MIT](http://opensource.org/licenses/MIT)\n","_attachments":{},"homepage":"https://github.com/mjackson/describe-property","bugs":{"url":"https://github.com/mjackson/describe-property/issues"},"license":"MIT"}