Can we reload environment variables (process.env
) with the updated values without restarting the nodejs app or server ?
In other words, I have created a new environment variable (NEW_VARIABLE
) and have set a value in my Windows 7 machine. Now I have written a function to read the environment variable as below in my NodeJS application.
setInterval(() => {
console.log(process.env.NEW_VARIABLE);
}, 5000);