Node.js CLI Environment & Config

Node.js CLI environment and config cheat sheets for NODE_OPTIONS, runtime environment variables, proxy settings, CA certificates, and launch patterns.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Environment Variables and NODE_OPTIONS
Preload with NODE_OPTIONS
NODE_OPTIONS="--require dotenv/config" node app.js

# Apply CLI flags through the environment.

Run with NODE_ENV=production
NODE_ENV=production node app.js

# Set common production mode.

Suppress warnings
NODE_NO_WARNINGS=1 node app.js

# Disable warning output.

Set timezone
TZ=UTC node app.js

# Run process in a chosen timezone.

Set libuv threadpool size
UV_THREADPOOL_SIZE=16 node app.js

# Tune worker threadpool size.

Add extra CA certificates
NODE_EXTRA_CA_CERTS=./internal-ca.pem node app.js

# Trust additional certificate authorities.

Honor HTTP proxy env vars
NODE_USE_ENV_PROXY=1 node app.js

# Tell Node to use HTTP_PROXY and related vars.

Use system CA store
NODE_USE_SYSTEM_CA=1 node app.js

# Load trusted CA certs from the OS store.

Recommended next

No recommendations yet.