Node.js
Run JavaScript outside the browser. Manage packages, scripts, and server-side applications with Node.js runtime commands.
66 commands
Browse by Topic
Getting Started
Quick setup and installation
Run
Running scripts
Debug
Debugging
Test
Built-in test runner
Performance
Memory & profiling
Security
Permissions & security
Modules
Module loading
REPL
Interactive mode
Environment
Environment & config
Install Node.js (macOS)
Install Node.js and npm using Homebrew on macOS
Check Node version
Display installed Node.js version
Check npm version
Display installed npm version
Run script
Execute JavaScript file.
Evaluate code
Evaluate JavaScript code directly.
Print expression
Evaluate and print result.
Watch mode
Auto-restart on file changes (Node.js 22+).
Watch specific paths
Watch specific directories for changes.
Preserve output on restart
Keep console output between restarts.
Run package script
Run package.json script (faster than npm run).
Load env file
Load environment variables from file.
Enable inspector
Enable V8 inspector (default: localhost:9229).
Break on first line
Start inspector and pause before execution.
Wait for debugger
Wait for debugger before starting.
Debug module logs
Enable debug logs for core modules.
Trace warnings
Show stack traces for all warnings.
Trace deprecations
Show stack traces for deprecations.
Remote debugging
Enable inspector on all interfaces (remote access).
Built-in CLI debugger
Start built-in command-line debugger (95K+ searches).
Trace on exit
Print stack trace when environment exits.
Throw on deprecation
Throw errors on deprecated API usage.
Inspector over HTTP
Publish inspector WebSocket URL over HTTP.
Abort on uncaught exception
Generate core dump on uncaught exceptions.
Run tests
Run test files (*.test.js pattern).
Filter tests by name
Run only tests matching pattern.
Test with coverage
Generate test coverage report.
TAP reporter
Output in TAP format (spec, dot, json, junit).
Coverage thresholds
Set minimum line coverage threshold.
Update snapshots
Update test snapshot files.
Spec reporter
Output tests with spec reporter (human-readable).
Increase heap size
Set max V8 heap to 4GB.
CPU profiling
Generate CPU profile (*.cpuprofile).
Heap profiling
Generate heap allocation profile.
Heap snapshot on signal
Generate heap dump on signal (kill -USR2 <pid>).
Heap snapshot on OOM
Generate snapshot before out-of-memory crash.
Expose GC
Expose global gc() function for manual GC.
V8 profiling
Generate V8 profile (isolate-*.log file).
Process V8 profile
Convert V8 profile to readable format.
Trace garbage collection
Print GC events to stderr (memory debugging).
CPU profile interval
Set CPU profiling sample interval (microseconds).
Heap profile interval
Set heap profiling sample interval (bytes).
Trace event categories
Enable trace events for specific categories.
Diagnostic report on signal
Generate diagnostic report on SIGUSR2 signal.
Report on fatal error
Auto-generate report on fatal errors.
Enable permissions
Enable permission restrictions (Node.js 23.5+).
Allow file reads
Allow reading files in /app directory only.
Allow file writes
Allow writing to /tmp only.
Allow network
Enable network access.
Disallow eval
Block eval() and new Function().
JIT-less mode
Disable JIT compilation (security-focused).
Preload module
Preload CommonJS module before main.
Import ES module
Preload ES module at startup.
Run as ES module
Treat eval/stdin as ES module.
Allow require(ESM)
Allow require() for ES modules (Node.js 22+).
Run TypeScript directly
Execute TypeScript without transpiling (Node.js 22+, 2026).
Start REPL
Start interactive Node.js REPL.
Force interactive
Force REPL even without TTY.
REPL help
Show REPL commands (.break, .clear, .exit, etc.).
Load file in REPL
Load JavaScript file into REPL session.
Save REPL history
Save all evaluated commands to file.
Set NODE_ENV
Run with production environment.
Set NODE_OPTIONS
Pass CLI flags via environment variable.
Show version
Print Node.js version.
Check syntax
Check syntax without executing.
Show V8 options
List all V8 command-line options.
Enable source maps
Enable source map support in stack traces.
Discussion
Loading comments...