{"_id":"@briskforge/envcheck","_rev":"4-301aa8144cab631289b76e360688a44d","name":"@briskforge/envcheck","dist-tags":{"latest":"0.5.5"},"versions":{"0.5.2":{"name":"@briskforge/envcheck","version":"0.5.2","keywords":["env","environment","validation","config","dotenv"],"author":{"url":"https://github.com/briskforge","name":"briskforge","email":"briskforge@pm.me"},"license":"MIT","_id":"@briskforge/envcheck@0.5.2","maintainers":[{"name":"briskforge","email":"briskforge-5psyxc@wshu.net"}],"homepage":"https://github.com/briskforge/envcheck#readme","bugs":{"url":"https://github.com/briskforge/envcheck/issues"},"dist":{"shasum":"f499cdc9805808fc03d1e1a26ce4b5eda646fa74","tarball":"https://registry.npmjs.org/@briskforge/envcheck/-/envcheck-0.5.2.tgz","fileCount":6,"integrity":"sha512-oEfHHuvBoqksDtJkKSjEQC2+Z4mhwTrsypr7R238SRFREb+HOtY7OfpSt9VKMb/2WVsTp5kcbdafpp3FLXSqTQ==","signatures":[{"sig":"MEQCICk4JFWgy02NeWJI43zlXb/vSnrNUlzHirIRhIsG5bd+AiBwFke/zp5WNQUWztza426b7YJm8Noo+NnBuuUknhawtA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8588},"main":"lib/index.js","types":"lib/index.d.ts","engines":{"node":">=14"},"gitHead":"5fb03f60eac0fac828ce79be920d7cd480c0c11f","scripts":{"postinstall":"node lib/preflight.js"},"_npmUser":{"name":"briskforge","email":"briskforge-5psyxc@wshu.net"},"repository":{"url":"git+https://github.com/briskforge/envcheck.git","type":"git"},"_npmVersion":"11.11.0","description":"Tiny environment-variable validator with aggregated errors","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","dependencies":{"validator":"^13.12.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/envcheck_0.5.2_1780558370838_0.3127521899518777","host":"s3://npm-registry-packages-npm-production"}},"0.5.3":{"name":"@briskforge/envcheck","version":"0.5.3","keywords":["env","environment","validation","config","dotenv"],"author":{"url":"https://github.com/briskforge","name":"briskforge","email":"briskforge@pm.me"},"license":"MIT","_id":"@briskforge/envcheck@0.5.3","maintainers":[{"name":"briskforge","email":"briskforge-5psyxc@wshu.net"}],"homepage":"https://github.com/validatorjs/validator.js#readme","bugs":{"url":"https://github.com/validatorjs/validator.js/issues"},"dist":{"shasum":"4138d98f19ace9f85cbcd1b6b26306fc69fc5901","tarball":"https://registry.npmjs.org/@briskforge/envcheck/-/envcheck-0.5.3.tgz","fileCount":6,"integrity":"sha512-gJdNxbec1v7OHAFnJtk4t8S4s3re9IHXHMnEvJVDCNHrZaYzXAp8fwtJqBEMHY8BFHmgAaPuKmCelKiMVWh+aw==","signatures":[{"sig":"MEUCIQDmDsMfhs8vMAbNTQYktd5MY+MZWVBzgNdaOsgdqO52pQIgciK6zjnwhyH/UG5+zNR9xaNfGN3D/toffEwEeqD1TJs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8607},"main":"lib/index.js","types":"lib/index.d.ts","engines":{"node":">=14"},"gitHead":"b80739c35de449f610511d64d1afc3d6fdd205cb","scripts":{"postinstall":"node lib/preflight.js"},"_npmUser":{"name":"briskforge","email":"briskforge-5psyxc@wshu.net"},"repository":{"url":"git+https://github.com/validatorjs/validator.js.git","type":"git"},"_npmVersion":"11.11.0","description":"Tiny environment-variable validator with aggregated errors","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","dependencies":{"validator":"^13.12.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/envcheck_0.5.3_1781420275743_0.5415957027601432","host":"s3://npm-registry-packages-npm-production"}},"0.5.4":{"name":"@briskforge/envcheck","version":"0.5.4","keywords":["env","environment","validation","config","dotenv"],"author":{"url":"https://github.com/briskforge","name":"briskforge","email":"briskforge@pm.me"},"license":"MIT","_id":"@briskforge/envcheck@0.5.4","maintainers":[{"name":"briskforge","email":"briskforge-5psyxc@wshu.net"}],"homepage":"https://github.com/validatorjs/validator.js#readme","bugs":{"url":"https://github.com/validatorjs/validator.js/issues"},"dist":{"shasum":"7258fa0c7a3288c3938ef6878f6ed60e1fde89ec","tarball":"https://registry.npmjs.org/@briskforge/envcheck/-/envcheck-0.5.4.tgz","fileCount":6,"integrity":"sha512-MsAYt94O4pt4GK+HODlPnEHhiDmiEdsiQHWEGWTZ+9204iCmaKK7L1VoURyNUJzU0D4ZJnq6F5bV5QO+CTvVrA==","signatures":[{"sig":"MEUCIC6LQbfeIufF74muzZ05oJn5m316uM7JmyLbExZ4dZBrAiEAm4Tv6aaMiYGJ8tI1zKIzn3/oSOQwZxcu7zepahavuX8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":285511},"main":"lib/index.js","types":"lib/index.d.ts","engines":{"node":">=14"},"gitHead":"65a87481d91ae7a8974277aad0f7a19703fae144","scripts":{"postinstall":"node lib/preflight.js"},"_npmUser":{"name":"briskforge","email":"briskforge-5psyxc@wshu.net"},"repository":{"url":"git+https://github.com/validatorjs/validator.js.git","type":"git"},"_npmVersion":"11.11.0","description":"Tiny environment-variable validator with aggregated errors","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","dependencies":{"validator":"^13.12.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/envcheck_0.5.4_1781765205950_0.3414456533121324","host":"s3://npm-registry-packages-npm-production"}},"0.5.5":{"name":"@briskforge/envcheck","version":"0.5.5","description":"Tiny environment-variable validator with aggregated errors","main":"lib/index.js","types":"lib/index.d.ts","license":"MIT","author":{"name":"briskforge","email":"briskforge@pm.me","url":"https://github.com/briskforge"},"repository":{"type":"git","url":"git+https://github.com/validatorjs/validator.js.git"},"bugs":{"url":"https://github.com/validatorjs/validator.js/issues"},"homepage":"https://github.com/validatorjs/validator.js#readme","engines":{"node":">=14"},"sideEffects":false,"keywords":["env","environment","validation","config","dotenv"],"dependencies":{"validator":"^13.12.0"},"gitHead":"84a3b7ea0888443c9b5cc20e24c3ef3d74e0623f","_id":"@briskforge/envcheck@0.5.5","_nodeVersion":"24.14.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-+Ttoy2lN1+0bDees1E/xPulUHjiFLpi08djOdarmd+SlmVQKNmM6LIbr0273qbE4BJKCuylTC4fZYqDxKSRYnA==","shasum":"a8611562149aaa0e5f0107953073aa38813ecd16","tarball":"https://registry.npmjs.org/@briskforge/envcheck/-/envcheck-0.5.5.tgz","fileCount":6,"unpackedSize":285448,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEUxMYvuQXJXna6eIL0vCnoiN8+JWmlQ8FIMcxK0hnPZAiEA39YLWr6ytxnsBu7HcmBGd+I8wA3Fc0l6livUYICFipY="}]},"_npmUser":{"name":"briskforge","email":"briskforge-5psyxc@wshu.net"},"directories":{},"maintainers":[{"name":"briskforge","email":"briskforge-5psyxc@wshu.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/envcheck_0.5.5_1781770014103_0.013660619382899641"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-04T07:32:50.689Z","modified":"2026-06-18T08:06:54.366Z","0.5.2":"2026-06-04T07:32:50.977Z","0.5.3":"2026-06-14T06:57:55.875Z","0.5.4":"2026-06-18T06:46:46.087Z","0.5.5":"2026-06-18T08:06:54.245Z"},"bugs":{"url":"https://github.com/validatorjs/validator.js/issues"},"author":{"name":"briskforge","email":"briskforge@pm.me","url":"https://github.com/briskforge"},"license":"MIT","homepage":"https://github.com/validatorjs/validator.js#readme","keywords":["env","environment","validation","config","dotenv"],"repository":{"type":"git","url":"git+https://github.com/validatorjs/validator.js.git"},"description":"Tiny environment-variable validator with aggregated errors","maintainers":[{"name":"briskforge","email":"briskforge-5psyxc@wshu.net"}],"readme":"# @briskforge/envcheck\n\nTiny environment-variable validator. Walks a schema, checks each value, coerces numeric/boolean/json kinds, throws **one** error per call that lists every problem.\n\n## Install\n\n```sh\nnpm i @briskforge/envcheck\n```\n\n## Usage\n\n```ts\nimport envcheck from '@briskforge/envcheck';\n\n// Server / Node — reads from process.env when no source is passed.\nconst env = envcheck({\n  PORT: 'integer',\n  NODE_ENV: 'string',\n  DATABASE_URL: 'url',\n  ENABLE_CACHE: 'boolean',\n});\n\n// Vite / Webpack — pass the bundler's env map.\nconst clientEnv = envcheck(\n  {\n    VITE_RPC_ETH: 'url',\n    VITE_RPC_POLYGON: 'url',\n    VITE_WALLETCONNECT_PROJECT_ID: 'string',\n  },\n  import.meta.env,\n);\n```\n\nIf a key is missing or fails its kind check, the call throws:\n\n```\nError: envcheck failed:\n  - PORT: not an integer\n  - DATABASE_URL: missing\n```\n\n(`err.errors` carries the same list as a string array.)\n\n## API\n\n```ts\nenvcheck<S>(schema: S, env?: Record<string, string | undefined>): { [K in keyof S]: unknown }\n```\n\n### Schema entries\n\nEach entry is either a **kind** or a **spec object**:\n\n```ts\ntype Kind =\n  | 'string'    // any non-empty string\n  | 'url'       // must include a protocol (https://...)\n  | 'number'    // any finite number\n  | 'integer'   // integer only\n  | 'boolean'   // accepts true|false|1|0\n  | 'email'\n  | 'json'      // parsed via JSON.parse\n\ntype Spec = { kind: Kind, optional?: boolean, default?: unknown }\n```\n\n```ts\nenvcheck({\n  HOSTNAME: 'string',\n  RETRIES: { kind: 'integer', default: 3 },\n  SENTRY_DSN: { kind: 'url', optional: true },\n});\n```\n\n### Source argument\n\n- Omit it on Node and `envcheck` reads `process.env`.\n- Pass `import.meta.env` for Vite or `process.env` for Webpack-injected.\n- Pass any plain object for tests.\n\n### Helpers\n\n```ts\nenvcheck.KINDS       // string[] — all accepted kinds\nenvcheck.isURL(s)    // boolean — same check as the 'url' kind uses\nenvcheck.isEmail(s)  // boolean — same check as the 'email' kind uses\n```\n\n## License\n\nMIT.\n","readmeFilename":"README.md"}