dotenv
require('dotenv').config();
console.log(process.env.MY_VARIABLE); // Prints the value of the "MY_VARIABLE" environment variablerequire('dotenv').config({ path: './my.env' });
console.log(process.env.MY_VARIABLE); // Prints the value of the "MY_VARIABLE" environment variable from the "my.env" filerequire('dotenv').config({ path: './.env.' + process.env.NODE_ENV });
console.log(process.env.MY_VARIABLE); // Prints the value of the "MY_VARIABLE" environment variable for the current environmentrequire('dotenv').config({ path: ['./.env', './my.env'] });
console.log(process.env.MY_VARIABLE); // Prints the value of the "MY_VARIABLE" environment variable from the first file that contains itprocess.env.MY_VARIABLE = 'overridden-value';
require('dotenv').config();
console.log(process.env.MY_VARIABLE); // Prints "overridden-value"