UNPKG

motion

Version:

motion - moving development forward

84 lines (83 loc) 5.11 kB
{ "_args": [ [ "lazy-cache@https://registry.npmjs.org/lazy-cache/-/lazy-cache-0.2.7.tgz", "/Users/nw/flint/packages/flint" ] ], "_from": "lazy-cache@>=0.2.4 <0.3.0", "_id": "lazy-cache@0.2.7", "_inCache": true, "_location": "/lazy-cache", "_phantomChildren": {}, "_requested": { "name": "lazy-cache", "raw": "lazy-cache@https://registry.npmjs.org/lazy-cache/-/lazy-cache-0.2.7.tgz", "rawSpec": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-0.2.7.tgz", "scope": null, "spec": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-0.2.7.tgz", "type": "remote" }, "_requiredBy": [ "/center-align" ], "_resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-0.2.7.tgz", "_shasum": "7feddf2dcb6edb77d11ef1d117ab5ffdf0ab1b65", "_shrinkwrap": null, "_spec": "lazy-cache@https://registry.npmjs.org/lazy-cache/-/lazy-cache-0.2.7.tgz", "_where": "/Users/nw/flint/packages/flint", "author": { "name": "Jon Schlinkert", "url": "https://github.com/jonschlinkert" }, "bugs": { "url": "https://github.com/jonschlinkert/lazy-cache/issues" }, "dependencies": {}, "description": "Cache requires to be lazy-loaded when needed.", "devDependencies": { "ansi-yellow": "^0.1.1", "glob": "^5.0.14", "mocha": "*" }, "engines": { "node": ">=0.10.0" }, "files": [ "index.js" ], "homepage": "https://github.com/jonschlinkert/lazy-cache", "keywords": [ "cache", "caching", "dependencies", "dependency", "lazy", "require", "requires" ], "license": "MIT", "main": "index.js", "name": "lazy-cache", "optionalDependencies": {}, "readme": "# lazy-cache [![NPM version](https://img.shields.io/npm/v/lazy-cache.svg)](https://www.npmjs.com/package/lazy-cache) [![Build Status](https://img.shields.io/travis/jonschlinkert/lazy-cache.svg)](https://travis-ci.org/jonschlinkert/lazy-cache)\n\n> Cache requires to be lazy-loaded when needed.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/)\n\n```sh\n$ npm i lazy-cache --save\n```\n\n## Usage\n\n```js\nvar lazy = require('lazy-cache')(require);\n```\n\n**Use as a property on `lazy`**\n\nThe module is also added as a property to the `lazy` function\nso it can be called without having to call a function first.\n\n```js\nvar lazy = require('lazy-cache')(require);\n\n// `npm install glob`\nlazy('glob');\n\n// glob sync\nconsole.log(lazy.glob.sync('*.js'));\n\n// glob async\nlazy.glob('*.js', function (err, files) {\n console.log(files);\n});\n```\n\n**Use as a function**\n\n```js\nvar lazy = require('lazy-cache')(require);\nvar glob = lazy('glob');\n\n// `glob` is a now a function that may be called when needed\nglob().sync('foo/*.js');\n```\n\n## Aliases\n\nAn alias may be passed as the second argument if you don't want to use the automatically camel-cased variable name.\n\n**Example**\n\n```js\nvar utils = require('lazy-cache')(require);\n\nutils('ansi-yellow', 'yellow');\nconsole.log(utils.yellow('foo'));\n```\n\n## Browserify usage\n\n**Example**\n\n```js\nvar utils = require('lazy-cache')(require);\n// temporarily re-assign `require` to trick browserify\nvar fn = require;\nrequire = utils;\n// list module dependencies (here, `require` is actually `lazy-cache`)\nrequire('glob');\nrequire = fn; // restore the native `require` function\n\n/**\n * Now you can use glob with the `utils.glob` variable\n */\n\n// sync\nconsole.log(utils.glob.sync('*.js'));\n\n// async\nutils.glob('*.js', function (err, files) {\n console.log(files.join('\\n'));\n});\n```\n\n## Kill switch\n\nIn certain rare edge cases, it may be necessary to unlazy all lazy-cached dependencies (two reported cases out of > 9 million downloads).\n\nTo force lazy-cache to immediately invoke all dependencies, do:\n\n```js\nprocess.env.UNLAZY = true;\n```\n\n## Related\n\n[lint-deps](https://www.npmjs.com/package/lint-deps): CLI tool that tells you when dependencies are missing from package.json and offers you a… [more](https://www.npmjs.com/package/lint-deps) | [homepage](https://github.com/jonschlinkert/lint-deps)\n\n## Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm i -d && npm test\n```\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/lazy-cache/issues/new).\n\n## Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)\n\n## License\n\nCopyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert)\nReleased under the MIT license.\n\n***\n\n_This file was generated by [verb](https://github.com/verbose/verb) on December 09, 2015._", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git+https://github.com/jonschlinkert/lazy-cache.git" }, "scripts": { "test": "mocha" }, "verb": { "plugins": [ "gulp-format-md" ], "related": { "list": [ "lint-deps" ] } }, "version": "0.2.7" }