npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

prisma-class-dto-generator

v7.0.3

Published

Generate Prisma DTOs with seamless class-validator and class-transformer integration for TypeScript applications.

Downloads

608

Readme

⚠️ DEPRECATED: Prisma Class DTO Generator

Important Notice: This package is now deprecated. We recommend using Prisma TypeBox Generator instead, which provides better performance and reliability with Fastify + TypeBox integration.

NPM Version GitHub Stars

⚡ Prisma DTO Generator – CLI & Programmatic Usage

❗🔴❗ Starting from version 7.0.0, prisma-class-dto-generator is no longer a Prisma generator but a standalone CLI tool and library that can be used independently. The package has been migrated to ESM (ECMAScript Modules) with NextNode to ensure compatibility with modern Node.js environments.

New: Prisma TypeBox Generator is our recommended solution that provides better performance and reliability with Fastify + TypeBox integration. It offers an intuitive UI tool that helps generate TypeBox schemas for Prisma without manual edits. Define your settings visually, export a generator-config.json, and seamlessly integrate schema generation into your workflow.

🔹 How It Works

You can use prisma-class-dto-generator in two ways:

  1. CLI Mode – Run from the command line.
  2. Programmatic Mode – Import and execute within your Node.js application.

🚀 CLI Usage

npx prisma-class-dto-generator --path=./prisma/schema.prisma --output=./dto_generated

or install globally:

npm install -g prisma-class-dto-generator
prismadtogen --path=./prisma/schema.prisma --output=./dto_generated

🎛 Available CLI Options

Usage: prismadtogen --path=[path_to_schema]

Options:
  --help, -h            Show this help message
  --version, -v         Show the installed version
  --path=[path]         Specify a Prisma schema file (default: ./prisma/schema.prisma)
  --output=[path]       Specify the output directory (default: ./dto_generated)

🎯 Why Use It?

Standalone & Flexible – Not tied to Prisma's generator system. ✅ ESM & NextNode Support – Fully compatible with modern Node.js environments. ✅ Error-Free DTO Generation – Automates repetitive DTO creation. ✅ Consistent & Maintainable – Ensures uniform DTO structures.


📦 Programmatic Usage

You can also use it inside a Node.js project:

import { generate } from "prisma-class-dto-generator";

await generate({
  cwd: process.cwd(),
  schemaPath: "./prisma/schema.prisma",
  output: "./dto_generated"
});

📌 Features

  • Automated DTO Generation – Creates input/output DTO classes for each Prisma model.
  • List DTOs – Supports pagination, filters, sorting, and flexible array elements.
  • Enum Handling – Generates enums from the Prisma schema.
  • Selective Generation – Fine-grained control over which models and fields to include.
  • Custom Decorators – Supports @filterable, @exclude input|output, @listable, and @orderable annotations.
  • File Type Support – Includes @IsFile and @IsFiles decorators for file uploads.
  • Lazy Imports for Deep Type Integration – Enables modular DTO architecture.
  • Class-Validator & OpenAPI Integration – Works seamlessly with class-validator, class-transformer, and routing-controllers-openapi.

🛠 Installation

npm install prisma-class-dto-generator

🔧 Configuration

The tool allows configuring DTO generation via a JSON file:

{
  "input": {
    "extendModels": {
      "Item": {
        "fields": [
          { "name": "title", "isRequired": false }
        ]
      }
    }
  }
}

🔗 Links & Resources

📌 Author

Developed by unbywyd.