{"name":"define-lazy-prop","version":"1.0.0","description":"Define a lazily evaluated property on an object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/define-lazy-prop.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["lazy","property","properties","prop","define","object","obj","value","lazily","laziness","val","evaluation","eval","execute","getter","function","fn","memoize","cache","defer","deferred"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"8077e201f5e9a269ab686873bca03b0a41719b26","bugs":{"url":"https://github.com/sindresorhus/define-lazy-prop/issues"},"homepage":"https://github.com/sindresorhus/define-lazy-prop#readme","_id":"define-lazy-prop@1.0.0","_shasum":"c9f83eabd8f2ce19e916f59ca68c06a2d175f210","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"c9f83eabd8f2ce19e916f59ca68c06a2d175f210","tarball":"http://registry-npm.ywwl.com/define-lazy-prop/download/define-lazy-prop-1.0.0.tgz","integrity":"sha512-CnLAc0n1gVX1zH/MnMmf/ar0ZKb+HFslZAgnf0n6soB2w7I4gjqC29i2f5KDVZ3lKxrdScDRAuF1kNSXPvgPxQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDW2nttKgrH7AzMJEce5NN2hlgcJcmqkUuimmcm+NZBwQIgM81VksV2QSaXhFnNkPeykBzs5v9YQqPTTAN43LrfTG4="}],"size":1939,"noattachment":false,"key":"/define-lazy-prop/-/define-lazy-prop-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/define-lazy-prop-1.0.0.tgz_1484489889934_0.29690037947148085"},"directories":{},"readme":"# define-lazy-prop\n\n> Define a [lazily evaluated](https://en.wikipedia.org/wiki/Lazy_evaluation) property on an object\n\nUseful when the value of a property is expensive to generate, so you want to delay the computation until the property is needed. For example, improving startup performance by deferring nonessential operations.\n\n## Install\n\n```\n$ npm install define-lazy-prop\n```\n\n## Usage\n\n```js\nimport defineLazyProperty from 'define-lazy-prop';\n\nconst unicorn = {\n\t// …\n};\n\ndefineLazyProperty(unicorn, 'rainbow', () => expensiveComputation());\n\napp.on('user-action', () => {\n\tdoSomething(unicorn.rainbow);\n});\n```\n\n## API\n\n### defineLazyProperty(object, propertyName, valueGetter)\n\n#### object\n\nType: `object`\n\nObject to add the property to.\n\n#### propertyName\n\nType: `string`\n\nName of the property to add.\n\n#### valueGetter\n\nType: `Function`\n\nCalled the first time `propertyName` is accessed. Expected to return a value.\n\n## Related\n\n- [lazy-value](https://github.com/sindresorhus/lazy-value) - Create a lazily evaluated value\n- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import a module lazily\n- [p-lazy](https://github.com/sindresorhus/p-lazy) - Create a lazy promise\n","publish_time":1484489891896,"_cnpm_publish_time":1484489891896,"dist-tags":{"latest":"3.0.0"}}