{"_id":"lazy-value","_rev":"330313","name":"lazy-value","description":"Create a lazily evaluated value","dist-tags":{"latest":"3.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2021-06-07T02:45:51.000Z","created":"2017-01-15T14:17:51.440Z","3.0.0":"2021-04-08T17:43:38.380Z","2.0.0":"2019-04-21T15:13:00.114Z","1.0.0":"2017-01-15T14:17:51.440Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/lazy-value.git"},"versions":{"3.0.0":{"name":"lazy-value","version":"3.0.0","description":"Create a lazily evaluated value","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/lazy-value.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava && tsd"},"keywords":["lazy","value","lazily","laziness","evaluation","eval","execute","getter","function","memoize","cache","defer","deferred"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.38.2"},"gitHead":"984c511eca4e2497d85271bf24260e936e348744","bugs":{"url":"https://github.com/sindresorhus/lazy-value/issues"},"homepage":"https://github.com/sindresorhus/lazy-value#readme","_id":"lazy-value@3.0.0","_nodeVersion":"15.12.0","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"497f6c13658e4ccdc41ba3a8734c47fbf653b407","size":1790,"noattachment":false,"key":"/lazy-value/-/lazy-value-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/lazy-value/download/lazy-value-3.0.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lazy-value_3.0.0_1617903818233_0.9048812955781358"},"_hasShrinkwrap":false,"publish_time":1617903818380,"_cnpm_publish_time":1617903818380},"2.0.0":{"name":"lazy-value","version":"2.0.0","description":"Create a lazily evaluated value","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/lazy-value.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["lazy","value","lazily","laziness","val","evaluation","eval","execute","getter","function","fn","memoize","cache","defer","deferred"],"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"72c2390291a78913ee2537cd5727c42c1cc5c21c","bugs":{"url":"https://github.com/sindresorhus/lazy-value/issues"},"homepage":"https://github.com/sindresorhus/lazy-value#readme","_id":"lazy-value@2.0.0","_nodeVersion":"8.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"037b50373d4cb6740cb4e6859d973a97c57115f9","size":1844,"noattachment":false,"key":"/lazy-value/-/lazy-value-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/lazy-value/download/lazy-value-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lazy-value_2.0.0_1555859579937_0.5633042254689544"},"_hasShrinkwrap":false,"publish_time":1555859580114,"_cnpm_publish_time":1555859580114},"1.0.0":{"name":"lazy-value","version":"1.0.0","description":"Create a lazily evaluated value","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/lazy-value.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["lazy","value","lazily","laziness","val","evaluation","eval","execute","getter","function","fn","memoize","cache","defer","deferred"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"128d690914efde573f50334584f1f60def2bf31d","bugs":{"url":"https://github.com/sindresorhus/lazy-value/issues"},"homepage":"https://github.com/sindresorhus/lazy-value#readme","_id":"lazy-value@1.0.0","_shasum":"06e2088790b3c72f7b16c5427be2c83ea302ce38","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"06e2088790b3c72f7b16c5427be2c83ea302ce38","size":1757,"noattachment":false,"key":"/lazy-value/-/lazy-value-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/lazy-value/download/lazy-value-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/lazy-value-1.0.0.tgz_1484489871224_0.5750132328830659"},"directories":{},"publish_time":1484489871440,"_cnpm_publish_time":1484489871440,"_hasShrinkwrap":false}},"readme":"# lazy-value\n\n> Create a [lazily evaluated](https://en.wikipedia.org/wiki/Lazy_evaluation) value\n\nUseful when a value is expensive to generate, so you want to delay the computation until the value is needed. For example, improving startup performance by deferring nonessential operations.\n\n## Install\n\n```\n$ npm install lazy-value\n```\n\n## Usage\n\n```js\nimport lazyValue from 'lazy-value';\n\nconst value = lazyValue(() => expensiveComputation());\n\napp.on('user-action', () => {\n\tdoSomething(value());\n});\n```\n\n## API\n\n### lazyValue(fn)\n\n#### fn\n\nType: `Function`\n\nExpected to return a value.\n\n## Related\n\n- [define-lazy-prop](https://github.com/sindresorhus/define-lazy-prop) - Define a lazily evaluated property on an object\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","_attachments":{},"homepage":"https://github.com/sindresorhus/lazy-value#readme","bugs":{"url":"https://github.com/sindresorhus/lazy-value/issues"},"license":"MIT"}