@gingacodemonkey/update-dotenv
v1.0.4
Published
Write updates to a .env file
Downloads
0
Readme
update-dotenv
A fork of davehensley/update-dotenv, which is a fork of bkeepers/update-dotenv
This adds support for wrapping lines with special characters (space or $) with a '
(single quote).
A NodeJS module to write updates to a .env file
Installation
// pnpm
pnpm add dotenv @gingacodemonkey/update-dotenv
// npm
npm install dotenv @gingacodemonkey/update-dotenv
//jsr
npx jsr add @gingacodemonkey/update-dotenv
pnpm dlx jsr add @gingacodemonkey/update-dotenv
Usage
MJS
import updateDotenv from'@gingacodemonkey/update-dotenv'
updateDotenv({
MY_VARIABLE: 'new value'
}).then((newEnv) => console.log('Done!', newEnv))
CJS
const {default: updateDotenv} = require('@gingacodemonkey/update-dotenv');
updateDotenv({
MY_VARIABLE: 'new value'
}).then((newEnv) => console.log('Done!', newEnv))