Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lazy-cache

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lazy-cache - npm Package Compare versions

Comparing version 0.2.3 to 0.2.4

2

index.js

@@ -37,3 +37,3 @@ 'use strict';

}
};
}
return getter;

@@ -40,0 +40,0 @@ };

{
"name": "lazy-cache",
"description": "Cache requires to be lazy-loaded when needed.",
"version": "0.2.3",
"version": "0.2.4",
"homepage": "https://github.com/jonschlinkert/lazy-cache",

@@ -13,3 +13,4 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",

"files": [
"index.js"
"index.js",
"utils.js"
],

@@ -16,0 +17,0 @@ "main": "index.js",

@@ -56,6 +56,32 @@ # lazy-cache [![NPM version](https://badge.fury.io/js/lazy-cache.svg)](http://badge.fury.io/js/lazy-cache)

```js
var utils = require('lazy-cache')(require);
utils('ansi-yellow', 'yellow');
console.log(utils.yellow('foo'));
```
## Browserify usage
**Example**
```js
var lazy = require('lazy-cache')(require);
// temporarily re-assign `require` to trick browserify
var fn = require;
require = lazy;
// list module dependencies here (`require` is actually `lazy`)
require('glob');
require = fn; // restore the native `require` function
lazy('ansi-yellow', 'yellow');
console.log(lazy.yellow('foo'));
/**
* Now you can use glob with the `lazy.glob` variable
*/
// sync
console.log(lazy.glob.sync('*.js'));
// async
lazy.glob('*.js', function (err, files) {
console.log(files.join('\n'));
});
```

@@ -65,3 +91,3 @@

[lint-deps](https://github.com/jonschlinkert/lint-deps): CLI tool that tells you when dependencies are missing from package.json and offers you a… [more](https://github.com/jonschlinkert/lint-deps)
[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)

@@ -78,3 +104,3 @@ ## Running tests

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/lazy-cache/issues/new)
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/lazy-cache/issues/new).

@@ -95,2 +121,2 @@ ## Author

_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 19, 2015._
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 24, 2015._
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc