Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
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
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.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.