@kleb/config (0.1.0)
Published 2026-07-03 14:24:26 +02:00 by kleb
Installation
@kleb:registry=npm install @kleb/config@0.1.0"@kleb/config": "0.1.0"About this package
@kleb/config
Typed configuration loading for TypeScript projects.
Validate caller-provided configuration with any Standard Schema-compatible schema:
import { loadConfig } from "@kleb/config";
const config = loadConfig(schema, {
PORT: "3000",
LOG_LEVEL: "info",
});
Use the server entrypoint to read process.env:
import { loadEnvConfig } from "@kleb/config/server";
const config = loadEnvConfig(schema, {
prefix: "APP_",
});
Prefix filtering strips the prefix by default before validation:
const config = loadEnvConfig(schema, {
prefix: "APP_",
keys: ["PORT", "LOG_LEVEL"],
});
Validation errors report paths and messages, but not raw config values.
Dependencies
Dependencies
| ID | Version |
|---|---|
| @standard-schema/spec | ^1.1.0 |