Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

edit-dotenv

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

edit-dotenv

Edit a .env file string with preserved whitespace.

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

edit-dotenv NPM Version Linux Build Windows Build Coverage Status Dependency Monitor

Edit a .env file string with preserved whitespace.

Installation

Node.js >= 4 is required. To install, type this at the command line:

npm install edit-dotenv

Usage

const editDotenv = require('edit-dotenv');

const envString = `VAR1=value
VAR2=value

# Comment
VAR3=value\\nvalue`;

const changes = {
  VAR2: 'new value',
  NEW: 'value'
};

editDotenv(envString, changes);
/*↴
VAR1=value
VAR2=new value

# Comment
VAR3=value\\nvalue

NEW=value
*/

Keywords

dotenv

FAQs

Package last updated on 12 Jul 2017

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