conf-with-zod
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

conf-with-zod

conf package with zod as json validator

Install

npm install conf-with-zod

Usage

This package works almost identical that original conf, with these diferences:

  • In the property schema you can pass a zod validator like this:
const zodSchema = z.object({
	foo: z.string().optional().default("Bar")
})

const store = new Conf({
	schema: zodSchema
})
  • Normal json-schemas already can passed as schema, but they will pass as conversion with json-schema-to-zod

Know Issues

  • Zod does not have support to unique property in arrays.

Credits

All rigths reserved to sindresorhus, owner of the original conf.

Package Sidebar

Install

npm i conf-with-zod

Weekly Downloads

4

Version

1.0.4

License

MIT

Unpacked Size

37.5 kB

Total Files

7

Last publish

Collaborators

  • arthur-lobo