{"_id":"@aarunyaapps/env-redact","_rev":"3-eabd3e2e85bc8f792eaef93610bf5366","name":"@aarunyaapps/env-redact","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"@aarunyaapps/env-redact","version":"1.0.0","keywords":["dotenv","env","secrets","redact","sanitize","security","privacy"],"license":"MIT","_id":"@aarunyaapps/env-redact@1.0.0","maintainers":[{"name":"suryahota","email":"surya.hota@gmail.com"}],"homepage":"https://github.com/aarunyaapps/env-redact#readme","bugs":{"url":"https://github.com/aarunyaapps/env-redact/issues"},"dist":{"shasum":"2134d254c67adb8b547afeb8b8c8c62ffb97e552","tarball":"https://registry.npmjs.org/@aarunyaapps/env-redact/-/env-redact-1.0.0.tgz","fileCount":5,"integrity":"sha512-wvRZjFSv+9I/xvDY5j4aswfAqA9wp9hu4xtq68PdffRqa6p+hGCM1g9dCLuC6DE+AFUSh2F5O5eiZGjIkQGZOg==","signatures":[{"sig":"MEUCIQC6ganx0GOUBjpkPkkLjYZVOZEhnVUZaLiiU6mGYtJT/QIgTFMbTXYaGWdkBhh1P7geji6FdEiFytNJX+jTuiVqJmQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15277},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"12de96c9e6a0c988b852c236f4a570a1dfee2b40","scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","build":"tsup src/index.ts --format cjs,esm --dts --clean","type-check":"tsc --noEmit"},"_npmUser":{"name":"suryahota","email":"surya.hota@gmail.com"},"repository":{"url":"git+https://github.com/aarunyaapps/env-redact.git","type":"git"},"_npmVersion":"11.15.0","description":"Parse .env files and detect/redact sensitive values. Zero dependencies. Browser + Node.js compatible.","directories":{},"_nodeVersion":"24.11.1","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/env-redact_1.0.0_1783235142957_0.15067098523127487","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@aarunyaapps/env-redact","version":"1.1.0","keywords":["dotenv","env","secrets","redact","sanitize","security","privacy","cli","ci","secret-scanning","env-example"],"license":"MIT","_id":"@aarunyaapps/env-redact@1.1.0","maintainers":[{"name":"suryahota","email":"surya.hota@gmail.com"}],"homepage":"https://github.com/aarunyaapps/env-redact#readme","bugs":{"url":"https://github.com/aarunyaapps/env-redact/issues"},"bin":{"env-redact":"dist/cli.js"},"dist":{"shasum":"1608851fc796abf1872879340ea309be74ccfc51","tarball":"https://registry.npmjs.org/@aarunyaapps/env-redact/-/env-redact-1.1.0.tgz","fileCount":7,"integrity":"sha512-KUZvDtouZLmdfqny+75BzEgUGCoC8C/V0vZW+hOOcKg3eN2/1QM7yWi2++ZixSIvD1P2b3OscVVJqPXBUPdkUQ==","signatures":[{"sig":"MEUCIQDBIQ1RdEyZGFjQoS6uWS1T2HhouqRrVRGcQfi407NrMwIgLx4MD2EkpO6CPh26PrWx+JSFspWZmz8R21gd91Xxm90=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27017},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"de8573805ee1b17aed68495c4450e0f7ccce7bd3","scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","build":"tsup src/index.ts --format cjs,esm --dts --clean && tsup src/cli.ts --format cjs --no-splitting","type-check":"tsc --noEmit"},"_npmUser":{"name":"suryahota","email":"surya.hota@gmail.com"},"repository":{"url":"git+https://github.com/aarunyaapps/env-redact.git","type":"git"},"_npmVersion":"11.15.0","description":"Parse .env files and detect/redact sensitive values. CLI + library, zero dependencies. Browser + Node.js compatible.","directories":{},"_nodeVersion":"24.11.1","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/env-redact_1.1.0_1783537412633_0.4490217989090477","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@aarunyaapps/env-redact","version":"1.1.1","description":"Parse .env files and detect/redact sensitive values. CLI + library, zero dependencies. Browser + Node.js compatible.","bin":{"env-redact":"dist/cli.js"},"main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"build":"tsup src/index.ts --format cjs,esm --dts --clean && tsup src/cli.ts --format cjs --no-splitting","dev":"tsup src/index.ts --format cjs,esm --dts --watch","type-check":"tsc --noEmit"},"keywords":["dotenv","env","secrets","redact","sanitize","security","privacy","cli","ci","secret-scanning","env-example"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aarunyatech/env-redact.git"},"devDependencies":{"tsup":"^8.0.0","typescript":"^5.8.3"},"gitHead":"de8573805ee1b17aed68495c4450e0f7ccce7bd3","_id":"@aarunyaapps/env-redact@1.1.1","bugs":{"url":"https://github.com/aarunyatech/env-redact/issues"},"homepage":"https://github.com/aarunyatech/env-redact#readme","_nodeVersion":"24.11.1","_npmVersion":"11.15.0","dist":{"integrity":"sha512-tf2Dg4uxYNQJiZHGMKW14j5zX9unbXptMiOYzoAM4e4k9aOcJ6E9tK8Y7qfabVzY3oGS4jvg+HqK7EOHeuZ+Og==","shasum":"168777b34bfecc0cfb74124bf8bd99b922fb5e80","tarball":"https://registry.npmjs.org/@aarunyaapps/env-redact/-/env-redact-1.1.1.tgz","fileCount":8,"unpackedSize":28112,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHi3tHdCyodsUgkjzd6bjnbnRiFXAToETQNPRKCihlRfAiEAiAg6XidflBpObD6F8TAWzPY95iD3sNY+Gbg5q4q4hs4="}]},"_npmUser":{"name":"suryahota","email":"surya.hota@gmail.com"},"directories":{},"maintainers":[{"name":"suryahota","email":"surya.hota@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/env-redact_1.1.1_1783537483365_0.3549231420010861"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-05T07:05:42.759Z","modified":"2026-07-08T19:04:43.697Z","1.0.0":"2026-07-05T07:05:43.102Z","1.1.0":"2026-07-08T19:03:32.802Z","1.1.1":"2026-07-08T19:04:43.587Z"},"bugs":{"url":"https://github.com/aarunyatech/env-redact/issues"},"license":"MIT","homepage":"https://github.com/aarunyatech/env-redact#readme","keywords":["dotenv","env","secrets","redact","sanitize","security","privacy","cli","ci","secret-scanning","env-example"],"repository":{"type":"git","url":"git+https://github.com/aarunyatech/env-redact.git"},"description":"Parse .env files and detect/redact sensitive values. CLI + library, zero dependencies. Browser + Node.js compatible.","maintainers":[{"name":"suryahota","email":"surya.hota@gmail.com"}],"readme":"# @aarunyaapps/env-redact\n\nParse `.env` files and detect / redact sensitive values. **Zero dependencies.** Works in Node.js and the browser.\n\nDetects 35+ secret patterns: API keys, tokens, passwords, connection strings, JWTs, private keys, and high-entropy values (Stripe, OpenAI, Anthropic, GitHub, AWS, Azure, GCP, Twilio, SendGrid, and more).\n\n> 🖥️ Prefer a UI? The same engine powers the free browser tool at **[aarunyaapps.com/env-sanitizer](https://aarunyaapps.com/env-sanitizer)** — 100% client-side, nothing leaves your machine.\n\n## CLI\n\nNo install needed:\n\n```bash\n# Redact .env to stdout\nnpx @aarunyaapps/env-redact\n\n# Generate a .env.example (keys only)\nnpx @aarunyaapps/env-redact --example --write .env.example\n\n# CI guard: exit 1 if a file contains live secrets\nnpx @aarunyaapps/env-redact .env.production --check\n```\n\n### Block secrets in CI\n\n```yaml\n# .github/workflows/ci.yml\n- name: Check for committed secrets in env files\n  run: npx @aarunyaapps/env-redact .env.example --check\n```\n\n### All options\n\n| Option | Description |\n|---|---|\n| `[file]` | Input file (default `.env`, `-` for stdin) |\n| `--example` | Output keys only, all values stripped |\n| `--check` | Exit 1 if sensitive values found (CI mode) |\n| `--write <file>` | Write output to a file instead of stdout |\n| `--placeholder <str>` | Replacement text (default `REDACTED`) |\n| `--json` | JSON summary: `{ total, sensitive, keys }` |\n\n## Library\n\n```bash\nnpm install @aarunyaapps/env-redact\n```\n\n```ts\nimport { parseEnv, buildSanitized, buildExample, countSensitive } from \"@aarunyaapps/env-redact\"\n\nconst lines = parseEnv(envFileContent)\n\nbuildSanitized(lines)                          // DATABASE_URL=REDACTED\nbuildSanitized(lines, { placeholder: \"***\" })  // DATABASE_URL=***\nbuildExample(lines)                            // DATABASE_URL=\ncountSensitive(lines)                          // 4\n```\n\n### API\n\n- `parseEnv(content: string): EnvLine[]` — parse into typed lines (`blank | comment | entry | invalid`); entries carry `key`, `value`, `sensitive`\n- `buildSanitized(lines, { placeholder? })` — sensitive values replaced, everything else byte-identical\n- `buildExample(lines)` — all values stripped (for `.env.example`)\n- `buildDiff(lines)` — line-level diff of what would change\n- `countSensitive(lines)` / `countTotal(lines)`\n- `isSensitiveKey(key)` / `isSensitiveValue(value)` — use the detection heuristics directly\n\nSupports `KEY=value` and `KEY: value` styles, `//`-commented-out secrets (`// API_KEY=...` is still flagged), and multi-line colon syntax.\n\n## Privacy\n\nThis package performs **no network calls, no telemetry, no file access** beyond what you pass it. The [browser version](https://aarunyaapps.com/env-sanitizer) runs entirely client-side.\n\n## License\n\nMIT © [Aarunya Apps](https://aarunyaapps.com)\n","readmeFilename":"README.md"}