{"_id":"import-lazy","_rev":"98782","name":"import-lazy","description":"Import a module lazily","dist-tags":{"latest":"4.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2021-06-03T10:33:22.000Z","created":"2017-05-21T09:49:08.163Z","4.0.0":"2019-04-27T10:42:11.495Z","3.1.0":"2017-11-03T14:30:53.408Z","3.0.0":"2017-06-14T18:50:44.279Z","2.1.0":"2017-05-21T09:49:08.163Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/import-lazy.git"},"versions":{"4.0.0":{"name":"import-lazy","version":"4.0.0","description":"Import a module lazily","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/import-lazy.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["import","require","load","module","modules","lazy","lazily","defer","deferred","proxy","proxies"],"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"eb40edcf6242280c68289758db9c22c5ecb455d6","bugs":{"url":"https://github.com/sindresorhus/import-lazy/issues"},"homepage":"https://github.com/sindresorhus/import-lazy#readme","_id":"import-lazy@4.0.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"e8eb627483a0a43da3c03f3e35548be5cb0cc153","size":2218,"noattachment":false,"key":"/import-lazy/-/import-lazy-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/import-lazy/download/import-lazy-4.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/import-lazy_4.0.0_1556361731280_0.9162848531790553"},"_hasShrinkwrap":false,"publish_time":1556361731495,"_cnpm_publish_time":1556361731495},"3.1.0":{"name":"import-lazy","version":"3.1.0","description":"Import a module lazily","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/import-lazy.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["import","require","load","module","modules","lazy","lazily","defer","deferred","proxy","proxies"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"9a1bbfe4f7e3618f8e6934372417251b5f219554","bugs":{"url":"https://github.com/sindresorhus/import-lazy/issues"},"homepage":"https://github.com/sindresorhus/import-lazy#readme","_id":"import-lazy@3.1.0","_npmVersion":"5.4.2","_nodeVersion":"8.7.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"891279202c8a2280fdbd6674dbd8da1a1dfc67cc","size":2076,"noattachment":false,"key":"/import-lazy/-/import-lazy-3.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/import-lazy/download/import-lazy-3.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/import-lazy-3.1.0.tgz_1509719453349_0.6365024524275213"},"directories":{},"publish_time":1509719453408,"_cnpm_publish_time":1509719453408,"_hasShrinkwrap":false},"3.0.0":{"name":"import-lazy","version":"3.0.0","description":"Import a module lazily","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/import-lazy.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"contributors":[{"name":"Jorge Bucaran","email":"jbucaran@me.com"}],"engines":{"node":">=6"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["import","require","load","module","modules","lazy","lazily","defer","deferred","proxy","proxies"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"e2fb3c26c104322690d84668bcde193bec7b14fa","bugs":{"url":"https://github.com/sindresorhus/import-lazy/issues"},"homepage":"https://github.com/sindresorhus/import-lazy#readme","_id":"import-lazy@3.0.0","_shasum":"aac9d230dd073097ba05c34bc39b8b03c586c064","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"aac9d230dd073097ba05c34bc39b8b03c586c064","size":2072,"noattachment":false,"key":"/import-lazy/-/import-lazy-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/import-lazy/download/import-lazy-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/import-lazy-3.0.0.tgz_1497466243296_0.5274067285936326"},"directories":{},"publish_time":1497466244279,"_hasShrinkwrap":false,"_cnpm_publish_time":1497466244279},"2.1.0":{"name":"import-lazy","version":"2.1.0","description":"Import modules lazily","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/import-lazy.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"contributors":[{"name":"Jorge Bucaran","email":"jbucaran@me.com"}],"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["import","require","load","module","modules","lazy","lazily","defer","deferred","proxy","proxies"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"ed6c2fac31aaf8a7d91a27295756383487f3965d","bugs":{"url":"https://github.com/sindresorhus/import-lazy/issues"},"homepage":"https://github.com/sindresorhus/import-lazy#readme","_id":"import-lazy@2.1.0","_shasum":"05698e3d45c88e8d7e9d92cb0584e77f096f3e43","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"05698e3d45c88e8d7e9d92cb0584e77f096f3e43","size":2293,"noattachment":false,"key":"/import-lazy/-/import-lazy-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/import-lazy/download/import-lazy-2.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/import-lazy-2.1.0.tgz_1495360148006_0.7086837058886886"},"directories":{},"publish_time":1495360148163,"_hasShrinkwrap":false,"_cnpm_publish_time":1495360148163}},"readme":"# import-lazy [![Build Status](https://travis-ci.org/sindresorhus/import-lazy.svg?branch=master)](https://travis-ci.org/sindresorhus/import-lazy)\n\n> Import a module lazily\n\n\n## Install\n\n```\n$ npm install import-lazy\n```\n\n\n## Usage\n\n```js\n// Pass in `require` or a custom import function\nconst importLazy = require('import-lazy')(require);\nconst _ = importLazy('lodash');\n\n// Instead of referring to its exported properties directly…\n_.isNumber(2);\n\n// …it's cached on consecutive calls\n_.isNumber('unicorn');\n\n// Works out of the box for functions and regular properties\nconst stuff = importLazy('./math-lib');\nconsole.log(stuff.sum(1, 2)); // => 3\nconsole.log(stuff.PHI); // => 1.618033\n```\n\n### Warning: Destructuring will cause it to fetch eagerly\n\nWhile you may be tempted to do leverage destructuring, like this:\n\n```js\nconst {isNumber, isString} = importLazy('lodash');\n```\n\nNote that this will cause immediate property access, negating the lazy loading, and is equivalent to:\n\n```js\nimport {isNumber, isString} from 'lodash';\n```\n\n## Related\n\n- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module from a given path\n- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path\n- [resolve-pkg](https://github.com/sindresorhus/resolve-pkg) - Resolve the path of a package regardless of it having an entry point\n- [lazy-value](https://github.com/sindresorhus/lazy-value) - Create a lazily evaluated value\n- [define-lazy-prop](https://github.com/sindresorhus/define-lazy-prop) - Define a lazily evaluated property on an object\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n","_attachments":{},"homepage":"https://github.com/sindresorhus/import-lazy#readme","bugs":{"url":"https://github.com/sindresorhus/import-lazy/issues"},"license":"MIT"}