open-index/open-npm huggingface dataset:
npm package: @pixeldrive/prisma-zod-generator
Description: Prisma 2+ generator to emit Zod schemas from your Prisma schema
Author: Omar Dulaimi
Latest version: 2.1.4

# @pixeldrive/prisma-zod-generator

> **Fork notice:** This is a fork of [omar-dulaimi/prisma-zod-generator](https://github.com/omar-dulaimi/prisma-zod-generator). The original project is maintained by [Omar Dulaimi](https://github.com/omar-dulaimi) and published as [`prisma-zod-generator`](https://www.npmjs.com/package/prisma-zod-generator) on npm.

Automatically generate [Zod](https://zod.dev) validation schemas from your Prisma schema.

[![npm version](https://img.shields.io/npm/v/@pixeldrive/prisma-zod-generator.svg?color=16C464&label=npm)](https://www.npmjs.com/package/@pixeldrive/prisma-zod-generator)
[![MIT](https://img.shields.io/badge/license-MIT-0a0a0a.svg)](./LICENSE)

## Installation

```bash
npm install -D @pixeldrive/prisma-zod-generator
```

## Quick Start

Add the generator to your `schema.prisma`:

```prisma
generator zod {
  provider = "prisma-zod-generator"
}
```

Then run:

```bash
npx prisma generate
```

Zod schemas will be generated in `./generated/schemas/` (configurable via the `output` option).

## Configuration

Create a `config.json` file and reference it from your schema:

```prisma
generator zod {
  provider = "prisma-zod-generator"
  config   = "./config.json"
}
```

```json
{
  "mode": "full"
}
```

For autocomplete and validation in your editor, point to the bundled JSON Schema:

```json
{
  "$schema": "../node_modules/@pixeldrive/prisma-zod-generator/lib/config/schema.json",
  "mode": "full"
}
```

## Features

- **Schema Generation** – Minimal, Full, and Custom modes; Schema Variants (input, result, pure models)
- **Customization** – Naming patterns, file structure control, selective generation, per-model config
- **Type Safety** – Zod v4 string formats, strict mode, full TypeScript integration
- **Multi-Provider** – SQLite, PostgreSQL, MySQL, MongoDB, SQL Server
- **Barrel Exports** – `enums/index.ts` and `objects/index.ts` barrel files generated automatically

## Contributing

PRs are welcome. Keep diffs focused and add tests for behaviour changes.

## License

MIT © [Omar Dulaimi](https://github.com/omar-dulaimi)