UNPKG

@zkochan/pnpm

Version:

Fast, disk space efficient package manager

114 lines (113 loc) 4.7 kB
{ "_args": [ [ { "raw": "import-lazy@^2.1.0", "scope": null, "escapedName": "import-lazy", "name": "import-lazy", "rawSpec": "^2.1.0", "spec": ">=2.1.0 <3.0.0", "type": "range" }, "/home/zkochan/src/pnpm/packages/pnpm/node_modules/update-notifier" ] ], "_from": "import-lazy@>=2.1.0 <3.0.0", "_id": "import-lazy@2.1.0", "_inCache": true, "_location": "/import-lazy", "_nodeVersion": "4.8.3", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/import-lazy-2.1.0.tgz_1495360148006_0.7086837058886886" }, "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "_npmVersion": "2.15.11", "_phantomChildren": {}, "_requested": { "raw": "import-lazy@^2.1.0", "scope": null, "escapedName": "import-lazy", "name": "import-lazy", "rawSpec": "^2.1.0", "spec": ">=2.1.0 <3.0.0", "type": "range" }, "_requiredBy": [ "/update-notifier" ], "_resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", "_shasum": "05698e3d45c88e8d7e9d92cb0584e77f096f3e43", "_shrinkwrap": null, "_spec": "import-lazy@^2.1.0", "_where": "/home/zkochan/src/pnpm/packages/pnpm/node_modules/update-notifier", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "bugs": { "url": "https://github.com/sindresorhus/import-lazy/issues" }, "contributors": [ { "name": "Jorge Bucaran", "email": "jbucaran@me.com" } ], "dependencies": {}, "description": "Import modules lazily", "devDependencies": { "ava": "*", "xo": "*" }, "directories": {}, "dist": { "shasum": "05698e3d45c88e8d7e9d92cb0584e77f096f3e43", "tarball": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz" }, "engines": { "node": ">=4" }, "files": [ "index.js" ], "gitHead": "ed6c2fac31aaf8a7d91a27295756383487f3965d", "homepage": "https://github.com/sindresorhus/import-lazy#readme", "keywords": [ "import", "require", "load", "module", "modules", "lazy", "lazily", "defer", "deferred", "proxy", "proxies" ], "license": "MIT", "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "name": "import-lazy", "optionalDependencies": {}, "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 modules lazily\n\n\n## Install\n\n```\n$ npm install --save 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// 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 = importLazy('lodash')('isNumber', 'isString');\n\n// Useful when using destructuring assignment in ES2015\nconst {isNumber, isString} = importLazy('lodash')('isNumber', 'isString');\n\n// Works out of the box for functions and regular properties\nconst stuff = importLazy('./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 importLazy = require('import-lazy').proxy(require);\nconst _ = importLazy('lodash');\n\n// No need to call it as a function but still lazily imported\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- [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", "readmeFilename": "readme.md", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/import-lazy.git" }, "scripts": { "test": "xo && ava" }, "version": "2.1.0" }