{"_id":"@birtalanrobert/config","_rev":"6-cac7a85aeec2a97518f42e4b17ab613e","name":"@birtalanrobert/config","dist-tags":{"latest":"1.3.0"},"versions":{"0.1.0":{"name":"@birtalanrobert/config","version":"0.1.0","license":"AGPL-3.0-only","_id":"@birtalanrobert/config@0.1.0","maintainers":[{"name":"birtalanrobert","email":"birtalanrobert@gmail.com"}],"homepage":"https://github.com/birtalanrobert/mortar#readme","bugs":{"url":"https://github.com/birtalanrobert/mortar/issues"},"dist":{"shasum":"bc0df23866dcb58901f4088b4658592a5b2a41ee","tarball":"https://registry.npmjs.org/@birtalanrobert/config/-/config-0.1.0.tgz","fileCount":40,"integrity":"sha512-VwpT3USyFEA1TK9le94uPHe0WchNgi9xdsjoAKsSa9hJ+2MMMSmgEcguSuNSQuJOfbs4RL7mvzno9DrtGVri6g==","signatures":[{"sig":"MEYCIQD7huIBFEFeMIfsDR2Of4ufIvqmNUmjGdduAPwH5ZknWAIhAIypOwrD/nknDHU3YLr/BAUX0GksNbnNQQLOWQ+696xJ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":95225},"main":"./dist/index.js","type":"commonjs","_from":"file:birtalanrobert-config-0.1.0.tgz","types":"./dist/index.d.ts","mortar":{"entries":["nestjs"]},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./nestjs":{"types":"./dist/nestjs/index.d.ts","default":"./dist/nestjs/index.js"},"./package.json":"./package.json"},"scripts":{"build":"tsc -p tsconfig.build.json","clean":"rm -rf dist *.tsbuildinfo","typecheck":"tsc -p tsconfig.json"},"_npmUser":{"name":"birtalanrobert","email":"birtalanrobert@gmail.com"},"_resolved":"/private/var/folders/zx/7dcyg3mn6kjfyzsymzgpx1jr0000gn/T/cf4fc453dfb00e8db739bb849c364486/birtalanrobert-config-0.1.0.tgz","_integrity":"sha512-VwpT3USyFEA1TK9le94uPHe0WchNgi9xdsjoAKsSa9hJ+2MMMSmgEcguSuNSQuJOfbs4RL7mvzno9DrtGVri6g==","repository":{"url":"git+https://github.com/birtalanrobert/mortar.git","type":"git","directory":"packages/config"},"_npmVersion":"11.13.0","description":"Environment schema validation with fail-at-boot semantics","directories":{},"_nodeVersion":"24.16.0","dependencies":{"zod":"^3.24.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@nestjs/common":"^10.0.0 || ^11.0.0"},"peerDependenciesMeta":{"@nestjs/common":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/config_0.1.0_1787664404501_0.4836386126474419","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@birtalanrobert/config","version":"0.2.0","license":"AGPL-3.0-only","_id":"@birtalanrobert/config@0.2.0","maintainers":[{"name":"birtalanrobert","email":"birtalanrobert@gmail.com"}],"homepage":"https://github.com/birtalanrobert/mortar#readme","bugs":{"url":"https://github.com/birtalanrobert/mortar/issues"},"dist":{"shasum":"766d257e3d3e18d174d45a72c2c0b9228e596248","tarball":"https://registry.npmjs.org/@birtalanrobert/config/-/config-0.2.0.tgz","fileCount":41,"integrity":"sha512-uFb9OlveYIsvAhLV2r6A/r7s7A+gf8e4C9Gh88ECqYu2hnY2luqcj8tr9UoyAyjTdtrfa6vzk4IIu66z90qzFg==","signatures":[{"sig":"MEUCIG5I/PDuRhb7FF61e4DCTa20Mb5tPjC4tIUtRYjup0GJAiEA0OtfOvm2dkWwqsI3rI0Zlxs5tm5UQXfWkqgtZBHVUWw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":98333},"main":"./dist/index.js","type":"commonjs","_from":"file:birtalanrobert-config-0.2.0.tgz","types":"./dist/index.d.ts","mortar":{"entries":["nestjs"]},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./nestjs":{"types":"./dist/nestjs/index.d.ts","default":"./dist/nestjs/index.js"},"./package.json":"./package.json"},"scripts":{"build":"tsc -p tsconfig.build.json","clean":"rm -rf dist *.tsbuildinfo","typecheck":"tsc -p tsconfig.json"},"_npmUser":{"name":"birtalanrobert","email":"birtalanrobert@gmail.com"},"_resolved":"/private/var/folders/zx/7dcyg3mn6kjfyzsymzgpx1jr0000gn/T/867288bf06019d071e40950579ad1bbe/birtalanrobert-config-0.2.0.tgz","_integrity":"sha512-uFb9OlveYIsvAhLV2r6A/r7s7A+gf8e4C9Gh88ECqYu2hnY2luqcj8tr9UoyAyjTdtrfa6vzk4IIu66z90qzFg==","repository":{"url":"git+https://github.com/birtalanrobert/mortar.git","type":"git","directory":"packages/config"},"_npmVersion":"11.13.0","description":"Environment schema validation with fail-at-boot semantics","directories":{},"_nodeVersion":"24.16.0","dependencies":{"zod":"^3.24.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@nestjs/common":"^10.0.0 || ^11.0.0"},"peerDependenciesMeta":{"@nestjs/common":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/config_0.2.0_1787732714233_0.9335147622149007","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@birtalanrobert/config","version":"1.0.0","license":"AGPL-3.0-only","_id":"@birtalanrobert/config@1.0.0","maintainers":[{"name":"birtalanrobert","email":"birtalanrobert@gmail.com"}],"homepage":"https://github.com/birtalanrobert/mortar#readme","bugs":{"url":"https://github.com/birtalanrobert/mortar/issues"},"dist":{"shasum":"eddbbab575bcae6c1ddfde9e9da48caf45f5eb75","tarball":"https://registry.npmjs.org/@birtalanrobert/config/-/config-1.0.0.tgz","fileCount":41,"integrity":"sha512-qJ73T0tn3+/VdplS0QlZtEIIxJWplBYJ8LrlNOn3vZU5KQYQdO9w9AR7kB4FcEGfM01z6HhOJGe8+HeqLuE2tQ==","signatures":[{"sig":"MEQCIGkxMEL1nfOUdTKCzPhNZp56mOiNBlpHr9JZTjk95s1fAiBA2c/7KYWcTvmyFkjqO8GYlMQnKm4jq1qX2d5qOnap+w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":101333},"main":"./dist/index.js","type":"commonjs","_from":"file:birtalanrobert-config-1.0.0.tgz","types":"./dist/index.d.ts","mortar":{"entries":["nestjs"]},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./nestjs":{"types":"./dist/nestjs/index.d.ts","default":"./dist/nestjs/index.js"},"./package.json":"./package.json"},"scripts":{"build":"tsc -p tsconfig.build.json","clean":"rm -rf dist *.tsbuildinfo","typecheck":"tsc -p tsconfig.json"},"_npmUser":{"name":"birtalanrobert","email":"birtalanrobert@gmail.com"},"_resolved":"/private/var/folders/zx/7dcyg3mn6kjfyzsymzgpx1jr0000gn/T/3f9645b793a1b76cd541782b0a4664fb/birtalanrobert-config-1.0.0.tgz","_integrity":"sha512-qJ73T0tn3+/VdplS0QlZtEIIxJWplBYJ8LrlNOn3vZU5KQYQdO9w9AR7kB4FcEGfM01z6HhOJGe8+HeqLuE2tQ==","repository":{"url":"git+https://github.com/birtalanrobert/mortar.git","type":"git","directory":"packages/config"},"_npmVersion":"11.13.0","description":"Environment schema validation with fail-at-boot semantics","directories":{},"_nodeVersion":"24.16.0","dependencies":{"zod":"^3.24.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@nestjs/common":"^10.0.0 || ^11.0.0"},"peerDependenciesMeta":{"@nestjs/common":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/config_1.0.0_1787735888288_0.3849135060735571","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@birtalanrobert/config","version":"1.1.0","license":"AGPL-3.0-only","_id":"@birtalanrobert/config@1.1.0","maintainers":[{"name":"birtalanrobert","email":"birtalanrobert@gmail.com"}],"homepage":"https://github.com/birtalanrobert/mortar#readme","bugs":{"url":"https://github.com/birtalanrobert/mortar/issues"},"dist":{"shasum":"1b39fbad8ef8351842ffe109633ae1ecb9d165fc","tarball":"https://registry.npmjs.org/@birtalanrobert/config/-/config-1.1.0.tgz","fileCount":41,"integrity":"sha512-YMAhqFwvKepR7YtupSZ8AUESvaUwvzR32rSO2XiQxHYBrbwHVOi0z5YmNc3f/bcBIXAjPOVXKh7Xk5OPaorMTA==","signatures":[{"sig":"MEYCIQCM2KDpoVJefvvw2HrwDcwCBbrm3fJBctoy1axNysXgSgIhAP+lBa0n0ilo/JKnULMxHRdM7BzgfpC2U+ZSA0Mfq8a2","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQDqZhIui683+Es5mvosXFWBGJXYYdKQgVuvpE1OX5TM5gIgY8/WCYgItLREP9Jr3/mkvJCKuGaX3sEt481A2+v648E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":175099},"main":"./dist/index.js","type":"commonjs","_from":"file:birtalanrobert-config-1.1.0.tgz","types":"./dist/index.d.ts","mortar":{"entries":["nestjs"]},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./nestjs":{"types":"./dist/nestjs/index.d.ts","default":"./dist/nestjs/index.js"},"./package.json":"./package.json"},"scripts":{"build":"tsc -p tsconfig.build.json","clean":"rm -rf dist *.tsbuildinfo","typecheck":"tsc -p tsconfig.json"},"_npmUser":{"name":"birtalanrobert","email":"birtalanrobert@gmail.com"},"_resolved":"/private/var/folders/zx/7dcyg3mn6kjfyzsymzgpx1jr0000gn/T/e7c5304ed77955519f78c4cc58646c98/birtalanrobert-config-1.1.0.tgz","_integrity":"sha512-YMAhqFwvKepR7YtupSZ8AUESvaUwvzR32rSO2XiQxHYBrbwHVOi0z5YmNc3f/bcBIXAjPOVXKh7Xk5OPaorMTA==","repository":{"url":"git+https://github.com/birtalanrobert/mortar.git","type":"git","directory":"packages/config"},"_npmVersion":"11.13.0","description":"Environment schema validation with fail-at-boot semantics","directories":{},"_nodeVersion":"24.16.0","dependencies":{"zod":"^3.24.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@nestjs/common":"^10.0.0 || ^11.0.0"},"peerDependenciesMeta":{"@nestjs/common":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/config_1.1.0_1789564345464_0.44216333181909007","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@birtalanrobert/config","version":"1.2.0","license":"AGPL-3.0-only","_id":"@birtalanrobert/config@1.2.0","maintainers":[{"name":"birtalanrobert","email":"birtalanrobert@gmail.com"}],"homepage":"https://github.com/birtalanrobert/mortar#readme","bugs":{"url":"https://github.com/birtalanrobert/mortar/issues"},"dist":{"shasum":"458a0f4b9bfe8f031daad85a5193b2da5c48cf0e","tarball":"https://registry.npmjs.org/@birtalanrobert/config/-/config-1.2.0.tgz","fileCount":41,"integrity":"sha512-hNQuOkE09otDcNZyLLl7Rg8VtPrAzMGaHT4uoFeyNDoq8ShX24H2+gfkBDn0IyTAd2dmVRJrg7QMjUUlmF+Gug==","signatures":[{"sig":"MEUCIQCZ1KKqJV4Fyu1akvmsVgv3UWf2nQQwpWHm8nrmVA5JlAIgS0F9IGeuXkyYJxazFQWBGdGwfmnZVfN7GAeKt9x7jLc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQCnzxHaxOd23a7O3ip+x2ba1FBmFsRogGWoQ9Ltf+x0FwIgAINlqzvP4PgqZoTtvdPqsFF7hMnKeBKXBVCQq6o96zU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":196582},"main":"./dist/index.js","type":"commonjs","_from":"file:birtalanrobert-config-1.2.0.tgz","types":"./dist/index.d.ts","mortar":{"entries":["nestjs"]},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./nestjs":{"types":"./dist/nestjs/index.d.ts","default":"./dist/nestjs/index.js"},"./package.json":"./package.json"},"scripts":{"build":"tsc -p tsconfig.build.json","clean":"rm -rf dist *.tsbuildinfo","typecheck":"tsc -p tsconfig.json"},"_npmUser":{"name":"birtalanrobert","email":"birtalanrobert@gmail.com"},"_resolved":"/private/var/folders/zx/7dcyg3mn6kjfyzsymzgpx1jr0000gn/T/33bc6077e7556393498a718c7f54bcb6/birtalanrobert-config-1.2.0.tgz","_integrity":"sha512-hNQuOkE09otDcNZyLLl7Rg8VtPrAzMGaHT4uoFeyNDoq8ShX24H2+gfkBDn0IyTAd2dmVRJrg7QMjUUlmF+Gug==","repository":{"url":"git+https://github.com/birtalanrobert/mortar.git","type":"git","directory":"packages/config"},"_npmVersion":"11.13.0","description":"Environment schema validation with fail-at-boot semantics","directories":{},"_nodeVersion":"24.16.0","dependencies":{"zod":"^3.24.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@nestjs/common":"^10.0.0 || ^11.0.0"},"peerDependenciesMeta":{"@nestjs/common":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/config_1.2.0_1789925517081_0.8734704480912034","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"_id":"@birtalanrobert/config@1.3.0","bugs":{"url":"https://github.com/birtalanrobert/mortar/issues"},"dist":{"shasum":"15cbc0357dd280812938fcd7cb59c01191ae3214","tarball":"https://registry.npmjs.org/@birtalanrobert/config/-/config-1.3.0.tgz","fileCount":41,"integrity":"sha512-Qtv4UfFJewReYGsb5v/xlRmES5Uqh3yus/nchOVRZ9/IW1brVwZ0uaUrdvOn0SKsH3HdzifuNajG2si2+i8s7g==","signatures":[{"sig":"MEUCIQDgzJ5EfswfXnAGo1i3s+Qz1GH2a6CNNN/nIwiIhEgIIgIgWJAQaatG7KY9tICC9EongzFLabbm1ovPXVA8+OGFWsg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDckMWdqG9JJZYSPjZwgUO5vfT6x1yXkHmHAGsG0JlKGwIgG+obDLGrcTlnr/WJUzYeugS8sVC1n6oBly/a6RCXSA4="}],"unpackedSize":210323},"main":"./dist/index.js","name":"@birtalanrobert/config","type":"commonjs","_from":"file:birtalanrobert-config-1.3.0.tgz","types":"./dist/index.d.ts","mortar":{"entries":["nestjs"]},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./nestjs":{"types":"./dist/nestjs/index.d.ts","default":"./dist/nestjs/index.js"},"./package.json":"./package.json"},"license":"AGPL-3.0-only","scripts":{"build":"tsc -p tsconfig.build.json","clean":"rm -rf dist *.tsbuildinfo","typecheck":"tsc -p tsconfig.json"},"version":"1.3.0","_npmUser":{"name":"birtalanrobert","email":"birtalanrobert@gmail.com"},"homepage":"https://github.com/birtalanrobert/mortar#readme","_resolved":"/private/var/folders/zx/7dcyg3mn6kjfyzsymzgpx1jr0000gn/T/6acbdd53adc31efb5c015c14b38c32fc/birtalanrobert-config-1.3.0.tgz","_integrity":"sha512-Qtv4UfFJewReYGsb5v/xlRmES5Uqh3yus/nchOVRZ9/IW1brVwZ0uaUrdvOn0SKsH3HdzifuNajG2si2+i8s7g==","repository":{"url":"git+https://github.com/birtalanrobert/mortar.git","type":"git","directory":"packages/config"},"_npmVersion":"11.13.0","description":"Environment schema validation with fail-at-boot semantics","directories":{},"maintainers":[{"name":"birtalanrobert","email":"birtalanrobert@gmail.com"}],"_nodeVersion":"24.16.0","dependencies":{"zod":"^3.24.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@nestjs/common":"^10.0.0 || ^11.0.0"},"peerDependenciesMeta":{"@nestjs/common":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/config_1.3.0_1790396874911_0.46771543940686455"}}},"time":{"created":"2026-08-25T13:26:44.322Z","modified":"2026-09-26T04:27:55.146Z","0.1.0":"2026-08-25T13:26:44.639Z","0.2.0":"2026-08-26T08:25:14.382Z","1.0.0":"2026-08-26T09:18:08.442Z","1.1.0":"2026-09-16T13:12:25.548Z","1.2.0":"2026-09-20T17:31:57.163Z","1.3.0":"2026-09-26T04:27:54.991Z"},"bugs":{"url":"https://github.com/birtalanrobert/mortar/issues"},"license":"AGPL-3.0-only","homepage":"https://github.com/birtalanrobert/mortar#readme","repository":{"url":"git+https://github.com/birtalanrobert/mortar.git","type":"git","directory":"packages/config"},"description":"Environment schema validation with fail-at-boot semantics","maintainers":[{"name":"birtalanrobert","email":"birtalanrobert@gmail.com"}],"readme":"# @birtalanrobert/config\n\nEnvironment validation with fail-at-boot semantics.\n\n## Using it in a NestJS application\n\n`ConfigModule.forRoot` — synchronous, and **first in the imports array**.\nNothing else can be configured until the environment has been validated, and\nevery other module below reads its options from this one.\n\n```ts\nimport { z } from 'zod';\nimport { ConfigModule } from '@birtalanrobert/config/nestjs';\nimport { envString, envInt, envBoolean, envDuration } from '@birtalanrobert/config';\n\nexport const envSchema = z.object({\n  NODE_ENV: z.enum(['development', 'test', 'production']).default('development'),\n  SERVICE_NAME: envString('my-api'),\n  PORT: envInt(3000),\n  DATABASE_URL: envString(),\n  SESSION_TTL: envDuration(30 * 24 * 60 * 60 * 1000), // accepts \"30d\"\n  FEATURE_X: envBoolean(false),\n});\n\nexport type AppConfig = z.infer<typeof envSchema>;\n\n@Module({\n  imports: [\n    ConfigModule.forRoot({\n      schema: envSchema,\n      // Prints the resolved configuration once at boot, secrets redacted.\n      logOnBoot: true,\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\nThere is no `forRootAsync`, deliberately: an asynchronous factory would need\nsomething to inject, and this is the thing everything else injects.\n\nThe module is `@Global()`, so one registration covers the whole application.\n\n## What the banner redacts\n\n`logOnBoot` prints every key once, through `describeConfig`, and nothing secret\nreaches it. A key whose name says it is a secret — `…PASSWORD`, `…TOKEN`,\nanything ending in `KEY` — is shown as a prefix and a length. Every other value\nhas any password inside a URL masked, because a connection string's key names\nno secret although its password is one: `DATABASE_URL` prints with its password\nas `***`, and its scheme, user, host and database as they are, still saying\nwhich role connected to which host. `redactConfig` applies the same rule for anything else that logs\nconfiguration.\n\n## Reading the configuration\n\nInject the validated object with `ConfigModule.token()`:\n\n```ts\nDatabaseModule.forRootAsync({\n  inject: [ConfigModule.token()],\n  useFactory: (config: AppConfig) => ({ url: config.DATABASE_URL }),\n});\n```\n\nOr in a provider:\n\n```ts\nimport { InjectConfig } from '@birtalanrobert/config/nestjs';\n\n@Injectable()\nexport class Thing {\n  constructor(@InjectConfig() private readonly config: AppConfig) {}\n}\n```\n\n**Never read `process.env` after this point.** A value read straight from the\nenvironment is one that nothing validated, nothing defaulted and no test can\noverride — and the failure is at the moment it is used rather than at boot.\n\n## Outside NestJS\n\nThe root entry has no framework dependency, so a worker, a script or a Next.js\nserver reads the same schema the same way:\n\n```ts\nimport { loadConfig } from '@birtalanrobert/config';\n\nconst config = loadConfig(envSchema);\n```\n\n## Why fail at boot\n\nA missing or malformed variable stops the process with a message naming every\nproblem at once, rather than the first. The alternative is `undefined` reaching\na database driver at three in the morning, where the error names neither the\nvariable nor the service.\n\n## The helpers\n\n`envString`, `envInt`, `envBoolean`, `envDuration`, `envList` exist because\neverything in an environment is a string. `envDuration` accepts `30d`, `12h`,\n`500ms` or a plain number of milliseconds — a TTL written as `2592000000` is a\nTTL nobody can check by eye.\n\n**`envString` is required and non-empty; `envText` may be empty.** The\ndifference is the difference between \"this service does not run without it\" and\n\"an address nobody published means the thing behind it is not there\" — a live\nchannel, an analytics endpoint, a support address. `envString('')` is refused\nwhere it is written rather than at boot: the schema it used to build\nsubstituted the default and then failed its own `min(1)`, so a variable\ndocumented as optional took every page down the first time somebody actually\nleft it unset.\n","readmeFilename":"README.md"}