You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

env-hot-reload

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

env-hot-reload

A small wrapper for watch changes in .env files , changes in .env auto parsed in process.env

1.1.2
latest
Source
npm
Version published
Weekly downloads
4
100%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

dotenv

FAQs

Package last updated on 05 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts