Skip to content

Repository files navigation

zodfig

Type-safe, hierarchical, modular config handling with Zod.

Installation

To install the package, run:

npm install zodfig

Usage

Here 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);

Development

To run tests, use:

npm test

To check linting, use:

npm run lint-check

To fix linting issues, use:

npm run lint

To check formatting, use:

npm run format-check

To format the code, use:

npm run format

License

This project is licensed under the terms of the Apache License 2.0. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages