rll

require-lazy-loader

require-lazy-loader is a lazy loader for Node.js modules. You use it instead of require in order to load a module only when it is going to be used.

Showing:

Popularity

Downloads/wk

1

GitHub Stars

1

Maintenance

Last Commit

7yrs ago

Contributors

0

Package

Dependencies

1

License

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Build Status Coverage Status

require-lazy-loader is a lazy loader for Node.js modules. you use it instead of require in order to load a module only when it is going to be used.

installing

npm install require-lazy-loader

usage

// use the `require` function in the module
var lazy = require('require-lazy-loader');

// or use your own
// this is needed when you are going to require local module
var lazy = require('require-lazy-loader')(require);

// use instead of `require`
var myFunc = lazy('./myFunc');

// if you're loading a function, you can just call the lazy loader the same you
// would the actual module
myFunc(1, 2, 3);

// you can also load the whole thing by calling `.get()`
myFunc = myFunc.get();

// it's also possible to to straight to a method of an object. paths to methods
// and properties are separated by spaces
var uniq = lazy('lodash uniq');

// when you execute the `uniq` method, lazy will load lodash, get a reference
// to the uniq method, and call it and return the results
uniq([ 1, 1, 2 ]);

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial