Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
EditEnv is a simple and efficient Node.js library for loading, parsing, editing, and saving .env files. Ideal for programmatically managing environment variables in your projects.
EditEnv is a simple and efficient Node.js library for loading, parsing, editing, and saving
.env
files. Ideal for programmatically managing environment variables in your projects.
npm install editenv
If you are using CommonJS modules (e.g., in Node.js environments that use require
), you can use the library like this:
const { EditEnvLoad, EditEnvAsJson, EditEnvGet, EditEnvSet } = require('editenv');
EditEnvLoad('./.env');
EditEnvAsJson('./.env');
EditEnvGet('./.env', 'EXISTING_KEY');
EditEnvSet('./.env', 'EXISTING_KEY', 'new_value');
EditEnvSet('./.env', 'NEW_KEY', 'new_value');
If you are using ES6 modules (e.g., in environments that support import
), you can use the library like this:
import { EditEnvLoad, EditEnvAsJson, EditEnvGet, EditEnvSet } from 'editenv';
EditEnvLoad('./.env');
EditEnvAsJson('./.env');
EditEnvGet('./.env', 'EXISTING_KEY');
EditEnvSet('./.env', 'EXISTING_KEY', 'new_value');
EditEnvSet('./.env', 'NEW_KEY', 'new_value');
EditEnvLoad(filePath)
Loads the content of the .env
file located at filePath
.
EditEnvAsJson(filePath)
Parses the .env
file located at filePath
and returns its contents as a JSON object.
EditEnvGet(filePath, key)
Gets the value associated with key
from the .env
file located at filePath
.
EditEnvSet(filePath, key, value)
Sets the value for key
in the .env
file located at filePath
. If the key does not exist, it is added.
FAQs
EditEnv is a simple and efficient Node.js library for loading, parsing, editing, and saving .env files. Ideal for programmatically managing environment variables in your projects.
The npm package editenv receives a total of 3 weekly downloads. As such, editenv popularity was classified as not popular.
We found that editenv demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.