@sgvolpe/env-diff-checker
v1.0.0
Published
Compare .env files and show value differences (not just presence)
Downloads
13
Maintainers
Readme
env-diff-checker
Compare .env files and show value differences — not just which variables exist, but how their values differ between files.
Installation
npm install @sgvolpe/env-diff-checkerUsage
# Compare .env, .env.example, .env.production
npx env-diff
# Compare two specific files
npx env-diff .env .env.productionAPI
import { diffEnvFiles, diffMultipleEnvFiles } from '@sgvolpe/env-diff-checker';
// Two files
const result = diffEnvFiles('.env', '.env.example');
// result.onlyInA, result.onlyInB, result.differentValues (key, valueA, valueB)
// Multiple files
const results = diffMultipleEnvFiles(['.env', '.env.example', '.env.production']);🔄 Difference from other packages
| Package | What it does | Our difference |
|---------|--------------|----------------|
| env-checker / @sgvolpe/env-checker | Checks which variables are missing or extra (presence only). Compares against .env.example. | env-diff-checker shows value differences. Same variable in both files but different values? We show it. API_URL = "http://localhost" vs "https://api.com". |
| znv, @zodyac/zod-env, validate-env-vars | Validate env vars against a schema (types, required, etc.) | env-diff-checker does comparison between files. No validation — pure diff. |
| dotenv | Loads .env into process.env | We don't load — we compare. |
TL;DR: env-checker = "do you have all the vars?". env-diff-checker = "do your .env files have the same values?". Catches config drift between dev/staging/prod.
