env-hot-reload
v1.1.2
Published
A small wrapper for watch changes in .env files , changes in .env auto parsed in process.env
Downloads
5
Maintainers
Readme
env-hot-reload
This small lib offers you the ability to edit your .env files without the need to restart the process.
env-hot-reload is watching your .env for you!
process.env.YourVars will auto updated every time you save .env file.
QuickStart
npm install env-hot-reload
oryarn add env-hot-reload
- Include it in your project :
const envHotReloader = require('env-hot-reload');
new envHotReloader({
onEnvChange: myFunctToCall, // optionall callback function runs on every .env update
watchInterval: 1500 // optionall default 3500
}).watch()
function myFunctToCall() {
// your code to run on .env is updated...
}
oR
const envHotReloader = require('env-hot-reload');
const config = {
onEnvChange: myFunctToCall, // optionall callback Function runs on every .env update
watchInterval: 1500 // optionall default 3500
}
const monitor = new envHotReloader(config)
monitor.watch();
function myFunctToCall() {
// your code to run when .env is updated...
}