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
// 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
import updateDotenv from'@gingacodemonkey/update-dotenv'
updateDotenv({
MY_VARIABLE: 'new value'
}).then((newEnv) => console.log('Done!', newEnv))
const {default: updateDotenv} = require('@gingacodemonkey/update-dotenv');
updateDotenv({
MY_VARIABLE: 'new value'
}).then((newEnv) => console.log('Done!', newEnv))