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.
node-autorequire
Advanced tools
A little module to facilitate easier require() calls
instead of doing a bunch of npm install --save {package} calls, just do one:
npm install --save node-autorequire
Then, in any script do:
const autoRequire = require('node-autorequire')(), someDep = autoRequire('some-dependency');
Now, when you run your master script, if some-dependency isn't found, it's installed and then returned back to the calling script, synchronously.
The node-autorequire export is a generator function. You call it to get a 'require-like' function. Without any arguments, packages are just installed, nothing more. You can configure to --save-dev by providing { saveDev: true } or --save with { save: true }. Normally, I find that this works well -- production code always wants a save and test code always wants a saveDev.
FAQs
a shim to require a module and npm install it if not found
The npm package node-autorequire receives a total of 0 weekly downloads. As such, node-autorequire popularity was classified as not popular.
We found that node-autorequire 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.