now
typespun
Typed config for TypeScript. One interface in, a generated, validated loader out.
- TypeScript
- 1,814 downloads on npm in the last monthas of , source

withdrew two broken versions, shipped 0.1.5 a day later
typespun: the loader says no
export interface AppConfig {
/** @env APP_PORT */
port: number;
}✓ port: 3000 (a number, as declared)
try “banana”. it’s okay to get this one wrong.
- APP_PORT=3000
- ✓ port: 3000 (a number, as declared)
- APP_PORT=banana
- APP_PORT must be a port number between 1 and 65535, got “banana”.
The problem
Every setting gets described three times: a TypeScript type, process.env parsing and a runtime schema. The three drift.
Decisions
- A committed, generated loader instead of a runtime schema.
typespun checkfails CI when the loader is stale.- Secrets are redacted from errors.


