prisma-zodifier
is a utility that facilitates the conversion of Prisma schemas to Zod schemas, providing you with a type-safe schema management solution.
Using npm:
npm install prisma-zodifier
Using yarn:
yarn add prisma-zodifier
Once the package is installed, you can run the prisma-zodifier
command:
yarn prisma-zodifier
By default, prisma-zodifier
will look for a schema.prisma
file in the prisma
directory of your project and generate the Zod schema in the root as zodSchemas.ts
.
You can also provide custom paths:
yarn prisma-zodifier path/to/your/prisma/schema.prisma path/to/your/output/zodSchema.ts
- Conversion of Prisma model fields to their respective Zod types.
- Conversion of Prisma enums to Zod unions.
- Type-safe Zod schema generation.
- Sorted Zod schema output.
To run the tests:
yarn test
For watch mode:
yarn test:watch
prisma-zodifier
is available under the MIT license. See the LICENSE
file for more info.