Intelligent multi-version dependency management for npm packages.
Install
npm install --save requirey
Usage
- #### Initialize
const ry = config options;
config
- object of module names mapped to arrays of supported versions
options
- extra options to override default behaviors like strict
Default behavior is strict mode enabled which will always use config to determine which versions can be installed and required
Strict mode will ignore version overrides for require calls
eg:
"lodash": '1.0.0' '2.1.2' ...
- #### Install
ry;
or
ry;// orry;ry;
- #### Require
const requirer = pkgJson; requirer; // ==> highest possible version supportedrequirer; // ==> version 1.0.0requirer; // ==> highest version in the range between 2.0.0 and 3.0.0requirer; // ==> highest version in the range between 2.2.0 to 2.3.0requirer; // ==> require sub-paths from auto-detected versionrequirer; // ==> require sub-paths from particular version
The require
method also takes an optional third parameter:
force
- boolean ==> Forces a require call for a particular version
requirer;