Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Intelligent multi-version dependency management for npm packages.
npm install --save requirey
const ry = require('requirey')(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'],
...
}
ry.installAll();
or
ry.install('lodash');
// or
ry.install('lodash', '1.0.0');
ry.install('lodash', '2.0.0');
const requirer = new ry.Requirer(pkgJson);
requirer.require('lodash'); // ==> highest possible version supported
requirer.require('lodash@1.0.0'); // ==> version 1.0.0
requirer.require('lodash', '^2.0.0'); // ==> highest version in the range between 2.0.0 and 3.0.0
requirer.require('lodash', '~2.2.0'); // ==> highest version in the range between 2.2.0 to 2.3.0
requirer.require('lodash/fp/curry'); // ==> require sub-paths from auto-detected version
requirer.require('lodash@3.0.0/array/chunk'); // ==> 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.require('lodash', '4.0.0', true);
2.2.0
strict
mode, treating the config
as source of truthrequire
callsFAQs
extending require to work with multiple versions of modules
The npm package requirey receives a total of 2 weekly downloads. As such, requirey popularity was classified as not popular.
We found that requirey demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.