Socket
Book a DemoInstallSign in
Socket

prisma-frontend

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prisma-frontend

A Prisma generator for creating frontend-friendly exports (types and enums).

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

DEPRECATED

This package is now deprecated as Prisma provides functionality to achieve the same thing that this package did: use moduleFormat = "esm" in your JS client generator now. (See https://www.prisma.io/docs/orm/prisma-schema/overview/generators#field-reference-1)

prisma-frontend

A Prisma generator for creating frontend-friendly exports (types and enums).

  • Generated outputs can be used just as easily in the backend or frontend, unifying the import source of your model types and enums.
  • Generated outputs are in ESM format.
  • This is experimental. Please open bug tickets in GitHub.

Install

npm i -D prisma-frontend

Usage

Prisma Schema

Insert this as a generator in your Prisma schema file:

// the standard client generator
generator jsClient {
    provider = "prisma-client-js"
    output   = "../generated"
}

// make sure this is placed after prisma-client-js
generator jsFrontend {
    provider = "prisma-frontend"
}

This generator requires the prisma-client-js generator to be used as well (as shown above).

Imports

Import model types and enums from prisma-frontend:

import {type User, AuthRole} from './generated/frontend/index.js';

export function authenticateAdmin(user: Partial<User>): boolean {
    return user.authRole === AuthRole.Admin;
}

Keywords

prisma

FAQs

Package last updated on 05 Sep 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