NODE_OPTIONS
An environment variable holding command-line options that every node process started in that environment applies, including child processes.
In more detail
For example NODE_OPTIONS=--max-old-space-size=512 sets the heap limit without changing the start command. Only some flags are allowed there, and the Node.js documentation lists which.
Related terms
- command-line flag — An option typed after a program's name to change how it runs, such as --watch in node --watch server.js.
- environment variable — A named setting such as PORT=8000 that a program reads from its surroundings when it starts.
- --max-old-space-size — A V8 option, passed to node, that sets the maximum size in megabytes of old space, the largest part of the JavaScript heap.
Taught in
- Runtime Configuration: CLI Flags & Native --env-file — Node.js Internals & Backend Services