{"_id":"@aritra_debnath/zero-env","_rev":"3-9f8c8e95e4737709368016216d42e4c9","name":"@aritra_debnath/zero-env","dist-tags":{"latest":"2.0.2"},"versions":{"2.0.0":{"name":"@aritra_debnath/zero-env","version":"2.0.0","keywords":[],"author":{"name":"Aritra Debnath"},"license":"ISC","_id":"@aritra_debnath/zero-env@2.0.0","maintainers":[{"name":"aritra_debnath","email":"aritradebnath1@gmail.com"}],"dist":{"shasum":"b9bd98d3537892dd5589bb2c6e7d8b6586628d6e","tarball":"https://registry.npmjs.org/@aritra_debnath/zero-env/-/zero-env-2.0.0.tgz","fileCount":4,"integrity":"sha512-Fg8j/On7oy1lkGY65EBzeqOlQg69+MkkfJSMavMvkZ+R0x2xLU6zkVVa1cuFpjB0j1Wvd2rBgSN91ic+2Q5hAg==","signatures":[{"sig":"MEUCIQC2GJPf3DRVAOFylksBOkw03Eo8HbcgNNpaQ1y/kHhY7QIgNoEKfgS0M1q8ZI07DHpxneo0QUdnDQPCtqVh5YJTi4s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3407},"main":"index.js","type":"module","types":"./index.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"aritra_debnath","email":"aritradebnath1@gmail.com"},"_npmVersion":"11.6.2","description":"Runtime Config","directories":{},"_nodeVersion":"23.7.0","dependencies":{"dotenv":"^17.2.3"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/zero-env_2.0.0_1765671251431_0.25692833003400883","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@aritra_debnath/zero-env","version":"2.0.1","keywords":[],"author":{"name":"Aritra Debnath"},"license":"MIT","_id":"@aritra_debnath/zero-env@2.0.1","maintainers":[{"name":"aritra_debnath","email":"aritradebnath1@gmail.com"}],"dist":{"shasum":"d24794da8f46bb956f0413d40d2b9a61925bd758","tarball":"https://registry.npmjs.org/@aritra_debnath/zero-env/-/zero-env-2.0.1.tgz","fileCount":4,"integrity":"sha512-nQbrzf8jU6+eUXTycHZIoRsvPmNQLn4kSIAfqB6/L37Mux06nAuDAwCU2gwTMb4vpMfgDYWgNxwMdv9ebtDGpA==","signatures":[{"sig":"MEUCIEArE1cYSjYL/Qcaa9BgsuMq8rksW1K8fQ4oxJ5lDLxVAiEA2j2OLrtg+kly7GtiiThu21uO8lBqN20LF/4sCwm6nug=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3449},"main":"index.js","type":"module","types":"./index.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"aritra_debnath","email":"aritradebnath1@gmail.com"},"_npmVersion":"11.6.2","description":"Runtime Config","directories":{},"_nodeVersion":"23.7.0","dependencies":{"dotenv":"^17.2.3"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/zero-env_2.0.1_1765672030183_0.009526553433122809","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"@aritra_debnath/zero-env","version":"2.0.2","description":"Runtime Config","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"author":{"name":"Aritra Debnath"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/JasonDebnath001/zero-env.git"},"bugs":{"url":"https://github.com/JasonDebnath001/zero-env/issues"},"homepage":"https://github.com/JasonDebnath001/zero-env#readme","type":"module","dependencies":{"dotenv":"^17.2.3"},"types":"./index.d.ts","_id":"@aritra_debnath/zero-env@2.0.2","_nodeVersion":"23.7.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-ravhs27QuVPam8d/qF+itaxK1/OZqFR2fLhu29GN4QzzTECUBgL0USvGKMiAWaU4AcW/IKAXH42iSim32J6dyw==","shasum":"1432e304cb291d5d8c3952428a4b42a5c9833666","tarball":"https://registry.npmjs.org/@aritra_debnath/zero-env/-/zero-env-2.0.2.tgz","fileCount":4,"unpackedSize":3705,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBTBTM4LgXaNsdxek5l/G2UCMlDDtkVKWZsVcGP5vsJgAiBhYo/ozcUwtV1squ7wm/BxVdGM04vm6dpuVvdb1rjpvA=="}]},"_npmUser":{"name":"aritra_debnath","email":"aritradebnath1@gmail.com"},"directories":{},"maintainers":[{"name":"aritra_debnath","email":"aritradebnath1@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/zero-env_2.0.2_1765672465567_0.3091867414488261"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-14T00:14:11.360Z","modified":"2025-12-14T00:34:25.935Z","2.0.0":"2025-12-14T00:14:11.563Z","2.0.1":"2025-12-14T00:27:10.330Z","2.0.2":"2025-12-14T00:34:25.744Z"},"author":{"name":"Aritra Debnath"},"license":"MIT","keywords":[],"description":"Runtime Config","maintainers":[{"name":"aritra_debnath","email":"aritradebnath1@gmail.com"}],"readme":"# Zero-env ⚡\r\n\r\n**The Runtime Config Validator for JS & Node.js.**\r\nZero-env Setup. Zero-env Schema. Auto-detects missing keys.\r\n\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\r\n\r\n## The Problem\r\n\r\nUsing `process.env` directly is dangerous. If you forget a variable, your app crashes randomly at 3 AM.\r\nLibraries like `zod` are great, but they require writing schemas, types, and config files.\r\n\r\n## The Solution\r\n\r\n**Zero-env** wraps your environment in a smart Proxy.\r\n\r\n- **0 Config:** No schema files. No setup.\r\n- **Auto-Load:** Automatically loads `.env` (bundles `dotenv`).\r\n- **Fail Fast:** Crashes **instantly** with a descriptive error if you access a missing variable.\r\n\r\n---\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm i @aritra_debnath/zero-env\r\n```\r\n\r\n---\r\n\r\n## Usage\r\n\r\n### 1. Create your `.env` file\r\n\r\n```env\r\nDATABASE_URL=postgres://localhost:5432/mydb\r\nAPI_KEY=secret_123\r\n```\r\n\r\n### 2. Import and Use\r\n\r\nInstead of `process.env`, import `Zero-env`.\r\n\r\n```javascript\r\nimport env from \"@aritra_debnath/zero-env\";\r\n\r\n// ✅ Works perfectly\r\nconnectToDb(env.DATABASE_URL);\r\n\r\n// ❌ CRASHES IMMEDIATELY\r\n// You forgot to add 'STRIPE_KEY' to your .env file\r\nconst payment = new Stripe(env.STRIPE_KEY);\r\n```\r\n\r\n### The Error Message\r\n\r\nIf you access a missing key, the app throws a fatal error intentionally:\r\n\r\n```text\r\nError: ❌ CRASH: Missing Environment Variable\r\nYou tried to access 'env.STRIPE_KEY' but it is not defined in your .env file.\r\n```\r\n\r\n---\r\n\r\n## TypeScript Support\r\n\r\nWorks out of the box. No manual typing required.\r\nThe package exports a default object where keys are treated as `string`.\r\n\r\n```typescript\r\nimport env from \"@aritra_debnath/zero-env\";\r\n\r\nconst key: string = env.API_KEY; // Type inferred as string\r\n```\r\n\r\n---\r\n\r\n## FAQ\r\n\r\n**Does this work with Next.js / Vite?**\r\nYes, but remember that client-side bundlers often replace `process.env.VAR` at build time. This package is designed primarily for **Node.js runtimes** (Backend, API routes, Scripts).\r\n\r\n**Why does console.log(env) look empty?**\r\nBecause it is a `Proxy`. It doesn't hold data itself; it intercepts requests to `process.env`. If you want to see all variables, use `console.log(process.env)`.\r\n\r\n---\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md","homepage":"https://github.com/JasonDebnath001/zero-env#readme","repository":{"type":"git","url":"git+https://github.com/JasonDebnath001/zero-env.git"},"bugs":{"url":"https://github.com/JasonDebnath001/zero-env/issues"}}