Skip to content

This small lib offers you the ability to edit your .env files without the need to restart the process.

License

Notifications You must be signed in to change notification settings

Kos-M/env-hot-reload

Repository files navigation

env-hot-reload

npm version npm downloads GitHub issues

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 or yarn 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...
  }

About

This small lib offers you the ability to edit your .env files without the need to restart the process.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published