Type-safe, hierarchical, modular config handling with Zod.
To install the package, run:
npm install zodfigHere is an example of how to use the zodfig function:
import { z } from "zod";
import { zodfig } from "zodfig";
const schema = z.object({
DATABASE_URL: z.string().url(),
PORT: z.coerce.number().min(1).max(65535),
});
const config = zodfig(schema).read();
console.log(config);To run tests, use:
npm testTo check linting, use:
npm run lint-checkTo fix linting issues, use:
npm run lintTo check formatting, use:
npm run format-checkTo format the code, use:
npm run formatThis project is licensed under the terms of the Apache License 2.0. See the LICENSE file for details.