
Research
/Security News
PolinRider Spreads Through Compromised GitHub Accounts and Packagist
Operators behind PolinRider used a compromised GitHub account to plant malware in four development versions of a Packagist package with 700,000+ downloads.
devkits-env-editor
Advanced tools
Parse, validate, and manipulate .env files. Compare .env with .env.example. Convert to JSON/YAML. Zero-dependency .env utility.
Parse, validate, and manipulate .env files. Compare .env with .env.example. Convert to JSON/YAML. Zero-dependency .env utility.
npm install @devkits/env-editor
const {
parse,
validate,
sort,
removeDuplicates,
toJSON,
toYAML,
toDocker,
mask,
generateExample,
compare
} = require('@devkits/env-editor');
const envContent = `
# Database config
DATABASE_URL=postgresql://user:pass@localhost:5432/mydb
SECRET_KEY=my-secret-key
PORT=3000
# Duplicate example
PORT=3001
`;
// Parse .env content
const { vars, errors } = parse(envContent);
// vars: [{type: 'comment', raw: '# Database config', line: 1}, ...]
// Validate
const result = validate(envContent);
// { valid: true, errors: [], warnings: ['Duplicate keys: PORT'], vars: 3 }
// Sort alphabetically
sort(envContent);
// DATABASE_URL=...
// PORT=3000
// PORT=3001
// SECRET_KEY=...
// Remove duplicates
removeDuplicates(envContent);
// Convert to JSON
toJSON(envContent);
// {
// "DATABASE_URL": "postgresql://user:pass@localhost:5432/mydb",
// "SECRET_KEY": "my-secret-key",
// "PORT": "3001"
// }
// Convert to YAML
toYAML(envContent);
// DATABASE_URL: "postgresql://..."
// Convert to Docker -e flags
toDocker(envContent);
// docker run \
// -e DATABASE_URL="..." \
// -e SECRET_KEY="..."
// Mask sensitive values
mask(envContent);
// DATABASE_URL=postgresql://...
// SECRET_KEY=********
// PORT=3000
// Generate .env.example
generateExample(envContent);
// DATABASE_URL=
// SECRET_KEY=
// PORT=
// Compare .env with .env.example
const envExample = `DATABASE_URL=
SECRET_KEY=
PORT=
REDIS_URL=`;
const diff = compare(envContent, envExample);
// { missing: ['REDIS_URL'], extra: [], match: false }
parse(content)Parses .env content into structured array with type, key, value, and line info.
toObject(vars)Converts parsed vars to plain object.
fromObject(obj)Converts object to .env format string.
validate(content)Validates .env content, returns {valid, errors, warnings, vars}.
sort(content)Sorts variables alphabetically (preserves comments at top).
removeDuplicates(content)Removes duplicate keys, keeping first occurrence.
toJSON(content, indent)Converts .env to JSON string.
toYAML(content)Converts .env to YAML format.
toDocker(content)Converts .env to Docker run command with -e flags.
mask(content)Masks sensitive values (keys containing: secret, key, password, token, etc.).
generateExample(content)Generates .env.example with empty values.
compare(envContent, exampleContent)Compares .env with .env.example, returns missing/extra keys.
Free Online Version: DevKits - .env Editor
| Package | Description |
|---|---|
| @devkits/base64-tool | Base64 encoding/decoding |
| @devkits/json-formatter | Format and validate JSON |
| @devkits/docker-compose-parser | Parse docker-compose files |
| @devkits/chmod-calculator | Unix file permissions |
Browse all 82 tools at DevKits
MIT
FAQs
Parse, validate, and manipulate .env files. Compare .env with .env.example. Convert to JSON/YAML. Zero-dependency .env utility.
The npm package devkits-env-editor receives a total of 3 weekly downloads. As such, devkits-env-editor popularity was classified as not popular.
We found that devkits-env-editor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Research
/Security News
Operators behind PolinRider used a compromised GitHub account to plant malware in four development versions of a Packagist package with 700,000+ downloads.

Security News
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.

Company News
Allow myself to introduce... myself.