
Security News
Node.js Drops Bug Bounty Rewards After Funding Dries Up
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.
@justsml/auto-config
Advanced tools
A Unified Config & Arguments Library for Node.js. Featuring support for environment variables, command line arguments, and JSON files!
A Unified Config & Arguments Library for Node.js!
Featuring support for environment variables, command line arguments, and (soon) JSON/YAML/INI files!
There are so many config libraries, do we really need another??? Well, possibly!
No existing library I tried met my requirements.
My goals & requirements include:
Table of Contents
npm install @justsml/auto-config
yarn add @justsml/auto-config
// `./src/config.ts`
import { autoConfig } from '@justsml/auto-config';
export default autoConfig({
databaseUrl: {
help: 'The Postgres connection string.',
args: ['--databaseUrl', '--db', 'DATABASE_URL'],
required: true,
},
port: {
help: 'The port to start server on.',
args: ['--port', '-p', 'PORT'],
type: 'number',
required: true,
},
debugMode: {
help: 'Debug mode.',
args: ['--debug', '-D'],
type: 'boolean',
default: false,
},
});
// `./src/app.js`
import config from './config';
console.log(config);
node ./src/app.js \
--port 8080 \
--databaseUrl 'postgres://localhost/postgres' \
--debug
# { port: 8080, databaseUrl: 'postgres://localhost/postgres', debug: true }
DATABASE_URL=postgres://localhost/postgres \
node ./src/app.js \
--port 8080 \
--debug
# { port: 8080, databaseUrl: 'postgres://localhost/postgres', debug: true }
node ./src/app.js \
-D \
--port 8080 \
--databaseUrl 'postgres://localhost/postgres'
# { port: 8080, databaseUrl: 'postgres://localhost/postgres', debug: true }
node ./src/app.js \
--port 8080
# Error: databaseUrl is required.
node ./src/app.js --help
╭───────────────────────────┬────────────────────────────────────────────┬──────────────────────────────────────────────────────────╮
│ │ │ │
│ Name │ Help │ CLI Args, Env Name(s) │
│ │ │ │
├───────────────────────────┼────────────────────────────────────────────┼──────────────────────────────────────────────────────────┤
│databaseUrl* │The Postgres connection string. │--databaseUrl, DATABASE_URI, DATABASE_URL │
├───────────────────────────┼────────────────────────────────────────────┼──────────────────────────────────────────────────────────┤
│port* │The port to serve content from. │-p, --port │
├───────────────────────────┼────────────────────────────────────────────┼──────────────────────────────────────────────────────────┤
│[debugMode] = false │Debug mode. │-D, --debug │
├───────────────────────────┼────────────────────────────────────────────┼──────────────────────────────────────────────────────────┤
│help │Show this help. │--help │
├───────────────────────────┼────────────────────────────────────────────┼──────────────────────────────────────────────────────────┤
│version │Show the current version. │--version │
╰───────────────────────────┴────────────────────────────────────────────┴──────────────────────────────────────────────────────────╯
--no-debug versus --debug.--help output.--version output.default values.required values.optional, min, max, gt, gte, lt, lte.Projects researched, with any notes on why it wasn't a good fit.
default helper function to check for env keys. Or we could transform yargs config into overlapping format.FAQs
A Unified Config & Arguments Library for Node.js. Featuring support for environment variables, command line arguments, and JSON files!
We found that @justsml/auto-config 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
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.