Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

prisma-enums-generator

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prisma-enums-generator

Generates enums from your Prisma schema to typescript or graphql files.

latest
npmnpm
Version
1.1.1
Version published
Weekly downloads
7
-12.5%
Maintainers
1
Weekly downloads
 
Created
Source

Prisma Enums Generator

Generates enums from your prisma schema to typescript or graphql files. Note it doesn't generate the typescript or types for shapes.

npm version GitHub Repo stars GitHub top language License

Installation

npm install prisma-enums-generator

Usage

generator enums {
  provider = "prisma-enums-generator"
  isExport = true
  useComma = true
  // output = "path to file"
}

Example


generator client {
  provider = "prisma-client-js"
}

generator enums {
  provider = "prisma-enums-generator"
  isExport = true
  useComma = true
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

enum UserType {
  pro
  best
}

model User {
  id       String    @unique @default(uuid())
  name     String
  username String
  type     UserType
}

Generates

  npx prisma generate

It will default generate the following file, prisma/types/index.ts with the following code

export enum UserType {
  pro,
  best,
}

Contributing

If you'd like to contribute, please follow our contribution guidelines.

Support

If you like the project, please consider supporting us by giving a ⭐️ on Github.

Bugs

If you find a bug, please file an issue on our issue tracker on GitHub

License

prisma-enums-generator is open-source software licensed under the MIT license.

Keywords

prisma

FAQs

Package last updated on 01 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts