prisma-zodifier

1.2.2 • Public • Published

prisma-zodifier

npm downloads

npm version License: MIT

prisma-zodifier is a utility that facilitates the conversion of Prisma schemas to Zod schemas, providing you with a type-safe schema management solution.

Table of Contents

Installation

Using npm:

npm install prisma-zodifier

Using yarn:

yarn add prisma-zodifier

Usage

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

Features

  • 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.

Testing

To run the tests:

yarn test

For watch mode:

yarn test:watch

License

prisma-zodifier is available under the MIT license. See the LICENSE file for more info.

Package Sidebar

Install

npm i prisma-zodifier

Weekly Downloads

29

Version

1.2.2

License

MIT

Unpacked Size

14.6 kB

Total Files

6

Last publish

Collaborators

  • tanctrl