
Security News
CISA Kills Off RSS Feeds for KEVs and Cyber Alerts
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
--require
hooks at the same timeChildProcess
, forwarding the current process.env
context† The ESM Loader API is still experimental and will change in the future.
$ npm install --save-dev loadr
Before
$ node --require dotenv/config \
--experimental-loader ts-node/esm \
--experimental-loader ./tests/loader.mjs \
server/index.mjs
After
$ loadr -- node server/index.mjs
// loadr.mjs
export const loaders = [
'ts-node/esm',
'./tests/loader.mjs',
]
export const registers = [
'dotenv/config',
]
# Run `npm test` using the `loadr.mjs` configuration file
$ loadr -- npm test
# Run `npm test` using custom `loadr.custom.js` file
$ loadr -c loadr.custom.js -- npm test
# Run `node server.mjs` w/o system bell
$ loadr -q -- node server.mjs
The loadr
binary expects the following usage:
$ loadr [options] -- <command>
Important: The
--
is required! It separates yourcommand
from yourloadr
arguments.
Please run loadr --help
for additional information.
Unless specified via the -c
or --config
CLI arguments, loadr
looks for a loadr.mjs
configuration file in the current working directory – aka process.cwd()
.
Type: string[]
A list of files and/or modules to be added as an --experimental-loader
hook.
Important: Any relative file paths will be resolved from the current working directory.
// loadr.mjs
export const loaders = [
"ts-node/esm", // third-party module
"./tests/loader.mjs", // local file
];
Type: string[]
A list of files and/or modules to be added as a --require
hook. Please note that ESM files cannot be loaded via a require()
statement.
Important: Any relative file paths will be resolved from the current working directory.
// loadr.mjs
export const requires = [
"esm", // third-party module
"dotenv/register", // third-party module
"./tests/setup.js", // local file
];
Type: Boolean
Default: false
By default, loadr
invokes the system bell when your command
process terminates with a non-zero exit code.
Note: If defined, the
-q
or--quiet
CLI argument takes precedence over the configuation file.
// loader.mjs
export const quiet = true;
MIT © Luke Edwards
FAQs
Quickly attach multiple ESM Loaders and/or --require hooks together
The npm package loadr receives a total of 212 weekly downloads. As such, loadr popularity was classified as not popular.
We found that loadr 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
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.