ehr
env-hot-reload
npm i env-hot-reload
ehr

env-hot-reload

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

by Kostas Mpoukouvalas

1.1.2 (see all)License:BSD-3-ClauseTypeScript:Not FoundCategories:Vanilla JavaScript Hot Reload
npm i env-hot-reload
Readme

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

Downloads/wk

25

GitHub Stars

2

LAST COMMIT

10mos ago

MAINTAINERS

1

CONTRIBUTORS

1

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
1.1.2
latest
10mos ago
No tutorials found
Add a tutorial