It's possible to debug Node.js process and change global variables:

On *nix, it's possible to enable debugging even if a process wasn't started in debug mode. On Windows, it's possible to debug only processes that were started with node --inspect
. This article explains both possibilities in detail.
Obviously, this will work only if environment variables are used directly all the time as process.env.FOO
.
If their values are initially used, changing process.env.FOO
later may not affect anything:
const FOO = process.env.FOO;
...
console.log(FOO); // it doesn't matter whether process.env.FOO was changed at this point