@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
Details
npm
2026-07-03 14:24:26 +02:00
4
UNLICENSED
12 KiB
Assets (1)
Versions (7) View all
0.7.0 2026-07-20
0.6.0 2026-07-14
0.5.0 2026-07-07
0.4.0 2026-07-04
0.3.0 2026-07-03