{"_id":"computed-property","_rev":"95856","name":"computed-property","description":"Add computed properties to JavaScript objects.","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"}],"time":{"modified":"2021-06-03T10:32:00.000Z","created":"2014-11-19T18:18:40.938Z","1.0.0":"2017-06-03T12:48:12.132Z","0.1.3":"2017-06-03T12:25:11.830Z","0.1.2":"2014-12-18T20:44:02.202Z","0.1.1":"2014-12-12T21:02:34.696Z","0.1.0":"2014-11-19T18:18:40.938Z"},"users":{},"author":{"name":"Brian Woodward","url":"https://github.com/doowb"},"repository":{"type":"git","url":"git+https://github.com/doowb/computed-property.git"},"versions":{"1.0.0":{"name":"computed-property","description":"Add computed properties to JavaScript objects.","version":"1.0.0","homepage":"https://github.com/doowb/computed-property","author":{"name":"Brian Woodward","url":"https://github.com/doowb"},"contributors":[{"name":"Brian Woodward","url":"https://twitter.com/doowb"},{"name":"Gilad Peleg","url":"http://www.giladpeleg.com"}],"repository":{"type":"git","url":"git+https://github.com/doowb/computed-property.git"},"bugs":{"url":"https://github.com/doowb/computed-property/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"clone-deep":"^0.3.0","get-value":"^0.3.2","set-value":"^1.0.0"},"devDependencies":{"benchmarked":"^0.1.3","calculate-assets":"^0.1.2","gulp-format-md":"^0.1.12","mocha":"*","should":"^4.3.0"},"keywords":["docs","documentation","generate","generator","markdown","templates","verb"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"lint":{"reflinks":true}},"gitHead":"011af1fa09456b3de356d0e6880fb5ad606239a7","_id":"computed-property@1.0.0","_npmVersion":"5.0.1","_nodeVersion":"6.10.1","_npmUser":{"name":"doowb","email":"brian.woodward@gmail.com"},"dist":{"shasum":"3fc8de52989e5b6fee3ecca16504bd3248283df7","size":3449,"noattachment":false,"key":"/computed-property/-/computed-property-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/computed-property/download/computed-property-1.0.0.tgz"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/computed-property-1.0.0.tgz_1496494091196_0.12204444454982877"},"directories":{},"publish_time":1496494092132,"_hasShrinkwrap":false,"_cnpm_publish_time":1496494092132},"0.1.3":{"name":"computed-property","description":"Add computed properties to JavaScript objects.","version":"0.1.3","homepage":"https://github.com/doowb/computed-property","author":{"name":"Brian Woodward","url":"https://github.com/doowb"},"contributors":[{"name":"Brian Woodward","url":"https://twitter.com/doowb"},{"name":"Gilad Peleg","url":"http://www.giladpeleg.com"}],"repository":{"type":"git","url":"git+https://github.com/doowb/computed-property.git"},"bugs":{"url":"https://github.com/doowb/computed-property/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"get-value":"^0.3.2","lodash.clonedeep":"3.0.1","set-object":"^0.1.0"},"devDependencies":{"benchmarked":"^0.1.3","calculate-assets":"^0.1.2","gulp-format-md":"^0.1.12","lodash":"^3.10.0","mocha":"*","should":"^4.3.0"},"keywords":["docs","documentation","generate","generator","markdown","templates","verb"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"lint":{"reflinks":true}},"gitHead":"2bbc2e7907529160f7662481f87f25bfdbb8a42e","_id":"computed-property@0.1.3","_npmVersion":"5.0.1","_nodeVersion":"6.10.1","_npmUser":{"name":"doowb","email":"brian.woodward@gmail.com"},"dist":{"shasum":"552c30b0c10ea93666d2a24641239d0eae3a59d6","size":3490,"noattachment":false,"key":"/computed-property/-/computed-property-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/computed-property/download/computed-property-0.1.3.tgz"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/computed-property-0.1.3.tgz_1496492710799_0.6925022136420012"},"directories":{},"publish_time":1496492711830,"_hasShrinkwrap":false,"_cnpm_publish_time":1496492711830},"0.1.2":{"name":"computed-property","description":"Add computed properties to JavaScript objects.","version":"0.1.2","homepage":"https://github.com/doowb/computed-property","author":{"name":"Brian Woodward","url":"https://github.com/doowb"},"repository":{"type":"git","url":"git://github.com/doowb/computed-property.git"},"bugs":{"url":"https://github.com/doowb/computed-property/issues"},"licenses":[{"type":"MIT","url":"https://github.com/doowb/computed-property/blob/master/LICENSE-MIT"}],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"benchmarked":"^0.1.3","calculate-assets":"^0.1.2","mocha":"*","should":"^4.3.0"},"keywords":["docs","documentation","generate","generator","markdown","templates","verb"],"dependencies":{"get-value":"^0.3.2","lodash":"^2.4.1","set-object":"^0.1.0"},"gitHead":"15d8e4df3b4e3786904ff920796806c63228e116","_id":"computed-property@0.1.2","_shasum":"4ddcb40ea6925c0b1ed7b85ebcd054ae3c57dd32","_from":".","_npmVersion":"1.4.26","_npmUser":{"name":"doowb","email":"brian.woodward@gmail.com"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"}],"dist":{"shasum":"4ddcb40ea6925c0b1ed7b85ebcd054ae3c57dd32","size":3712,"noattachment":false,"key":"/computed-property/-/computed-property-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/computed-property/download/computed-property-0.1.2.tgz"},"directories":{},"publish_time":1418935442202,"_cnpm_publish_time":1418935442202,"_hasShrinkwrap":false},"0.1.1":{"name":"computed-property","description":"Add computed properties to JavaScript objects.","version":"0.1.1","homepage":"https://github.com/doowb/computed-property","author":{"name":"Brian Woodward","url":"https://github.com/doowb"},"repository":{"type":"git","url":"git://github.com/doowb/computed-property.git"},"bugs":{"url":"https://github.com/doowb/computed-property/issues"},"licenses":[{"type":"MIT","url":"https://github.com/doowb/computed-property/blob/master/LICENSE-MIT"}],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"mocha":"*","should":"^4.3.0"},"keywords":["docs","documentation","generate","generator","markdown","templates","verb"],"dependencies":{"get-value":"^0.3.2","lodash":"^2.4.1","set-object":"^0.1.0"},"gitHead":"1192283e866bb0aefcb1b405faaeb34f7872a0d4","_id":"computed-property@0.1.1","_shasum":"5be68498f44b59d59d7bfc4b9e40a0dddd08bcb2","_from":".","_npmVersion":"1.4.26","_npmUser":{"name":"doowb","email":"brian.woodward@gmail.com"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"}],"dist":{"shasum":"5be68498f44b59d59d7bfc4b9e40a0dddd08bcb2","size":4036,"noattachment":false,"key":"/computed-property/-/computed-property-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/computed-property/download/computed-property-0.1.1.tgz"},"directories":{},"publish_time":1418418154696,"_cnpm_publish_time":1418418154696,"_hasShrinkwrap":false},"0.1.0":{"name":"computed-property","description":"Add computed properties to JavaScript objects.","version":"0.1.0","homepage":"https://github.com/doowb/computed-property","author":{"name":"Brian Woodward","url":"https://github.com/doowb"},"repository":{"type":"git","url":"git://github.com/doowb/computed-property.git"},"bugs":{"url":"https://github.com/doowb/computed-property/issues"},"licenses":[{"type":"MIT","url":"https://github.com/doowb/computed-property/blob/master/LICENSE-MIT"}],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"mocha":"*","should":"^4.3.0"},"keywords":["docs","documentation","generate","generator","markdown","templates","verb"],"dependencies":{"lodash":"^2.4.1"},"gitHead":"b5c583c6321770e22579b3dcb611fdb2cfe5af39","_id":"computed-property@0.1.0","_shasum":"744884707348605470f3f97e3a53c7e3b28001c2","_from":".","_npmVersion":"1.4.26","_npmUser":{"name":"doowb","email":"brian.woodward@gmail.com"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"}],"dist":{"shasum":"744884707348605470f3f97e3a53c7e3b28001c2","size":3815,"noattachment":false,"key":"/computed-property/-/computed-property-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/computed-property/download/computed-property-0.1.0.tgz"},"directories":{},"publish_time":1416421120938,"_cnpm_publish_time":1416421120938,"_hasShrinkwrap":false}},"readme":"# computed-property [![NPM version](https://img.shields.io/npm/v/computed-property.svg?style=flat)](https://www.npmjs.com/package/computed-property) [![NPM monthly downloads](https://img.shields.io/npm/dm/computed-property.svg?style=flat)](https://npmjs.org/package/computed-property)  [![NPM total downloads](https://img.shields.io/npm/dt/computed-property.svg?style=flat)](https://npmjs.org/package/computed-property) [![Linux Build Status](https://img.shields.io/travis/doowb/computed-property.svg?style=flat&label=Travis)](https://travis-ci.org/doowb/computed-property) [![Windows Build Status](https://img.shields.io/appveyor/ci/doowb/computed-property.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/doowb/computed-property)\n\n> Add computed properties to JavaScript objects.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save computed-property\n```\n\nInstall with [yarn](https://yarnpkg.com):\n\n```sh\n$ yarn add computed-property\n```\n\n## Usage\n\n```js\nvar computedProperty = require('computed-property');\n```\n\n## API\n\n### [computedProperty](index.js#L99)\n\nAdd a computed property to an object. This updates the property when dependent properties are updated.\n\n**Params**\n\n* `obj` **{Object}**: Object to add the property to.\n* `property` **{String}**: Name of the property.\n* `dependencies` **{Array}**: Optional list of properties to depend on.\n* `getter` **{Function}**: Getter function that does the calculation.\n\n**Example**\n\n```js\nvar computedProperty = require('computed-property');\nvar file = {\n  name: 'home-page',\n  ext: '.hbs',\n  dirname: 'views',\n  data: {\n    title: 'Home'\n  }\n};\n\ncomputedProperty(\n  // object\n  file,\n  // property name\n  'path',\n  // optional dependencies (may be deeply nested)\n  ['name', 'ext', 'dirname', 'data.title'],\n  // getter function\n  function () {\n    return this.dirname + '/' + this.name + this.ext;\n  });\n```\n\n## About\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Contributors\n\n| **Commits** | **Contributor** |  \n| --- | --- |  \n| 10 | [doowb](https://github.com/doowb) |  \n| 7  | [pgilad](https://github.com/pgilad) |  \n\n### Building docs\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n### Running tests\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n### Author\n\n**Brian Woodward**\n\n* [github/doowb](https://github.com/doowb)\n* [twitter/doowb](https://twitter.com/doowb)\n\n### License\n\nCopyright © 2017, [Brian Woodward](https://github.com/doowb).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 03, 2017._","_attachments":{},"homepage":"https://github.com/doowb/computed-property","bugs":{"url":"https://github.com/doowb/computed-property/issues"},"license":"MIT"}