nodemon.json env block for non-secret variables only
0 reputation · 03 Oct 2026, 16:23 UTC
Configuration goal
Inject environment variables into restarted Node processes through nodemon.json while keeping production credentials out of the shared configuration file.
nodemon reads nodemon.json from the project root by default and merges the env object into the child process environment on each restart. The file supports non-secret values such as PORT or NODE_ENV, but it provides no built-in secret vault, encryption, automatic redaction, or warning for keys that resemble passwords, API keys, or session secrets. Committed values are readable by anyone with repository access, and nodemon does not enforce file permissions or distinguish its own variables from shell-exported variables at runtime.
The team wants nodemon.json under version control for local development convenience, yet production credentials must never be committed. It is unclear whether nodemon offers any configuration boundary, alternate config-file handling, or loading rule that prevents secret-like values from being persisted alongside non-secret settings.
Does nodemon provide a way to separate injectable development variables from production credentials without moving all environment loading into the application itself?