edit-dotenv
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 = ; const envString = `VAR1=valueVAR2=value # CommentVAR3=value\\nvalue`; const changes = VAR2: 'new value' NEW: 'value'; ;/*↴VAR1=valueVAR2=new value # CommentVAR3=value\\nvalue NEW=value*/