1.0.1 • Published 5 years ago

hotenv v1.0.1

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

HotEnv

With this module you can programmatically reload environment variables. You can also attempt to evaluate/guess the variables themselves: a string would be converted into boolean, number, array, or json object (in this order). If none of these conversions has success the value type remains "string".

let hotenv = require('hotenv');
hotenv(); // by default it loads process.cwd()+'/.env' file

// somewhere in the code...
hotenv(__dirname+'/.env2', true) // this will let you override or add new values (with type guessing).

// somewhere in the code...
hotenv(__dirname+'/.env') // this will let you refresh original env values (but it keeps the added ones in the previous step) or any other value if .env has been modified