{"_rev":"4-3f20546ea84fab4fbae00263507b754f","time":{"created":"2025-12-09T06:06:17.269Z","modified":"2025-12-09T06:06:18.034Z","1.0.3":"2025-12-09T05:38:26.811Z","1.0.1":"2025-12-09T06:06:17.528Z"},"_id":"@dcs-soni/envdiff","name":"@dcs-soni/envdiff","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.1":{"name":"@dcs-soni/envdiff","version":"1.0.1","description":"Compare .env files to find missing or extra variables. Values are never read.","type":"module","main":"dist/index.js","exports":{".":"./dist/index.js","./parse":"./dist/parse.js","./compare":"./dist/compare.js","./format":"./dist/format.js"},"bin":{"envdiff":"dist/index.js"},"scripts":{"build":"tsc","prepublishOnly":"npm run build"},"keywords":["env","dotenv","diff","compare","environment","variables","cli"],"author":"","license":"MIT","repository":{"type":"git","url":"git+https://github.com/dcs-soni/envdiff.git"},"engines":{"node":">=18"},"devDependencies":{"@types/node":"^24.10.2","typescript":"^5.3.0"},"_id":"@dcs-soni/envdiff@1.0.1","gitHead":"59a525631e9de5c3aab4c0632b15e23eeb9b0013","bugs":{"url":"https://github.com/dcs-soni/envdiff/issues"},"homepage":"https://github.com/dcs-soni/envdiff#readme","_nodeVersion":"20.19.6","_npmVersion":"10.8.2","dist":{"integrity":"sha512-2tb6EnlRpIuJb4TOv45B+2Y7SDCWx5YD/qCA681KmbPI0S9Mf0MIP6Ze/hvGL0sHbptyk1DAS1en83Vph1iIWA==","shasum":"2d369990f0ca6a3d15c675aa1c376bf075a819c5","tarball":"https://registry.npmjs.org/@dcs-soni/envdiff/-/envdiff-1.0.1.tgz","fileCount":6,"unpackedSize":5229,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dcs-soni%2fenvdiff@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDISz7aDB+SnaYprnnIwfTIGcL6Hpnhr1WEZj72KHeXQAIgGdK4Ebw8tR7MyHRIXxIUce5ytG3ypbwiW69FhRICMn8="}]},"_npmUser":{"name":"dcs-soni","email":"divyanshusoni52@gmail.com"},"directories":{},"maintainers":[{"name":"dcs-soni","email":"divyanshusoni52@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/envdiff_1.0.1_1765260377371_0.47501819137383006"},"_hasShrinkwrap":false}},"maintainers":[{"name":"dcs-soni","email":"divyanshusoni52@gmail.com"}],"description":"Compare .env files to find missing or extra variables. Values are never read.","homepage":"https://github.com/dcs-soni/envdiff#readme","keywords":["env","dotenv","diff","compare","environment","variables","cli"],"repository":{"type":"git","url":"git+https://github.com/dcs-soni/envdiff.git"},"bugs":{"url":"https://github.com/dcs-soni/envdiff/issues"},"license":"MIT","readme":"# envdiff\n\nCompare `.env` files to find missing or extra variables.\n\n**Values are never read** - only key names are compared.\n\n## Security\n\nThis tool is designed for trust:\n\n- **Zero runtime dependencies** - no supply chain risk\n- **Values never read** - only parses key names, ignores everything after `=`\n- **No network calls** - runs entirely offline\n- **~70 lines of code** - fully auditable in 2 minutes\n- **Open source** - review the code yourself before using\n\n```bash\n# Verify zero dependencies\nnpm ls --prod\n# (empty output = no runtime dependencies)\n```\n\n## Installation\n\n```bash\nnpm install\nnpm run build\n```\n\nTo use globally:\n```bash\nnpm link\n```\n\n## Usage\n\n```bash\nenvdiff <file1> <file2>\n```\n\n### Examples\n\nCompare `.env.example` against your local `.env`:\n```bash\nenvdiff .env.example .env\n```\n\nCompare staging vs production:\n```bash\nenvdiff .env.staging .env.production\n```\n\n### Output\n\n```\nMissing in .env:\n  - REDIS_URL\n  - API_SECRET\n\nExtra in .env:\n  + OLD_UNUSED_VAR\n```\n\n## Exit Codes\n\n- `0` - No differences found\n- `1` - Differences found or error occurred\n\n## Use in CI/CD\n\nAdd to your pipeline to catch missing env vars before deployment:\n\n```yaml\n# GitHub Actions\n- name: Check env vars\n  run: npx envdiff .env.example .env.production\n```\n\n```yaml\n# GitLab CI\ncheck-env:\n  script:\n    - npx envdiff .env.example .env.production\n```\n\n## Use as a Module\n\n```typescript\nimport { parseEnvKeys } from './parse.js';\nimport { compareEnvKeys } from './compare.js';\nimport { formatDiff } from './format.js';\n\nconst keys1 = parseEnvKeys('API_KEY=xxx\\nDEBUG=true');\nconst keys2 = parseEnvKeys('API_KEY=yyy');\n\nconst diff = compareEnvKeys(keys1, keys2);\n// { missing: [], extra: ['DEBUG'] }\n\nconsole.log(formatDiff(diff, 'source', 'target'));\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}