{"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"keywords":["require","load","module","modules","lazy","lazily","defer","deferred","proxy","proxies"],"dist-tags":{"latest":"2.0.0"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"description":"Require modules lazily","readme":"# lazy-req [![Build Status](https://travis-ci.org/sindresorhus/lazy-req.svg?branch=master)](https://travis-ci.org/sindresorhus/lazy-req)\n\n> Require modules lazily\n\n\n## Install\n\n```\n$ npm install --save lazy-req\n```\n\n\n## Usage\n\n```js\n// pass in `require` or a custom require function\nconst lazyReq = require('lazy-req')(require);\nconst _ = lazyReq('lodash');\n\n// Where you would normally do\n_.isNumber(2);\n\n// You now instead call it as a function\n_().isNumber(2);\n\n// It's cached on consecutive calls\n_().isString('unicorn');\n\n// Extract lazy variations of the props you need\nconst members = lazyReq('lodash')('isNumber', 'isString');\n\n// Useful when using destructuring assignment in ES2015\nconst {isNumber, isString} = lazyReq('lodash')('isNumber', 'isString');\n\n// Works out of the box for functions and regular properties\nconst stuff = lazyReq('./math-lib')('sum', 'PHI');\nconsole.log(stuff.sum(1, 2)); // => 3\nconsole.log(stuff.PHI); // => 1.618033\n```\n\n### Proxy support in Node.js 6 or later\n\nIf you use Node.js 6 or later, you can take advantage of ES2015 proxies and don't need to call it as a function.\n\n```js\nconst lazyReq = require('lazy-req').proxy(require);\nconst _ = lazyReq('lodash');\n\n// No need to call it as a function but still lazily required\n_.isNumber(2);\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- [req-from](https://github.com/sindresorhus/req-from) - Require 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","repository":{"type":"git","url":"git+https://github.com/sindresorhus/lazy-req.git"},"users":{"danielbayley":true},"bugs":{"url":"https://github.com/sindresorhus/lazy-req/issues"},"license":"MIT","versions":{"1.0.0":{"name":"lazy-req","version":"1.0.0","description":"Require modules lazily","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/lazy-req"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"node test.js"},"files":["index.js"],"keywords":["require","load","module","modules","lazy","lazily","defer","deferred"],"devDependencies":{"ava":"0.0.3"},"gitHead":"fa7b4ade760b39b9ed01daec882269b498f4dd0e","bugs":{"url":"https://github.com/sindresorhus/lazy-req/issues"},"homepage":"https://github.com/sindresorhus/lazy-req","_id":"lazy-req@1.0.0","_shasum":"fc9a9050bd005ee7b42a9a497d075884e4a470f0","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"dist":{"shasum":"fc9a9050bd005ee7b42a9a497d075884e4a470f0","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/lazy-req/-/lazy-req-1.0.0.tgz"},"directories":{}},"1.1.0":{"name":"lazy-req","version":"1.1.0","description":"Require modules lazily","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/lazy-req"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"contributors":[{"name":"Jorge Bucaran","email":"jbucaran@me.com"}],"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && node test.js"},"files":["index.js"],"keywords":["require","load","module","modules","lazy","lazily","defer","deferred"],"devDependencies":{"ava":"0.0.4","xo":"*"},"gitHead":"9ac4b63005b62a04ef4d237b046d014f94e8aee5","bugs":{"url":"https://github.com/sindresorhus/lazy-req/issues"},"homepage":"https://github.com/sindresorhus/lazy-req","_id":"lazy-req@1.1.0","_shasum":"bdaebead30f8d824039ce0ce149d4daa07ba1fac","_from":".","_npmVersion":"2.11.2","_nodeVersion":"0.12.5","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"bdaebead30f8d824039ce0ce149d4daa07ba1fac","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/lazy-req/-/lazy-req-1.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{}},"2.0.0":{"name":"lazy-req","version":"2.0.0","description":"Require modules lazily","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/lazy-req.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":["require","load","module","modules","lazy","lazily","defer","deferred","proxy","proxies"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"498395dd746a0ecfd6aeb785ecb93c593d5a680f","bugs":{"url":"https://github.com/sindresorhus/lazy-req/issues"},"homepage":"https://github.com/sindresorhus/lazy-req#readme","_id":"lazy-req@2.0.0","_shasum":"c9450a363ecdda2e6f0c70132ad4f37f8f06f2b4","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.6.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"c9450a363ecdda2e6f0c70132ad4f37f8f06f2b4","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/lazy-req/-/lazy-req-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/lazy-req-2.0.0.tgz_1484646276710_0.28619852592237294"},"directories":{}}},"name":"lazy-req","contributors":[{"name":"Jorge Bucaran","email":"jbucaran@me.com"}],"time":{"modified":"2017-03-26T00:04:51.091Z","created":"2014-08-16T16:01:11.014Z","1.0.0":"2014-08-16T16:01:11.014Z","1.1.0":"2015-08-10T08:54:46.271Z","2.0.0":"2017-01-17T09:44:36.932Z"},"readmeFilename":"readme.md","homepage":"https://github.com/sindresorhus/lazy-req#readme"}