conf-with-zod
v1.0.5
Published
Simple config handling for your app or module
Downloads
146
Maintainers
Readme
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.