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

nesor

v0.1.1

Published

Generate clean, modular TypeScript domain entities from your Prisma schema. One file per model, doc-comment-driven exclusion, variants, and static metadata for your own mappers.

Readme

nesor

A Prisma generator that emits clean, modular TypeScript domain entities — one file per model, doc-comment-driven exclusion, variants, branded IDs, and static EntityMeta for your own mappers. Prisma comes bundled, so pnpm add -D nesor is the only install you need.

Quick start

Three commands from zero to generated entities:

pnpm add -D nesor
pnpm nesor init       # bootstraps prisma/schema.prisma + adds the nesor block
pnpm nesor generate   # writes one <model>.entity.ts per model

That's it. Under the hood Nesor wraps the full Prisma CLI, so nesor migrate dev, nesor studio, nesor format, nesor db pull, and any other prisma subcommand are forwarded verbatim. You can still call pnpm prisma <...> directly if you prefer; both paths hit the same prisma that ships with Nesor.

What you get

For this schema:

/// A primary domain entity.
/// @nesor-variant Compact include=id,name
model ModelA {
  /// @nesor-brand ModelAId
  id     String   @id
  name   String
  count  Int
  /// @nesor-secret
  apiKey String
}

Nesor emits a single file, fully typed, zero runtime deps:

// AUTO-GENERATED BY NESOR — DO NOT EDIT

export type ModelAId = string & { readonly __brand: 'ModelAId' }

/** A primary domain entity. */
export interface ModelAEntity {
  id: ModelAId
  name: string
  count: number
}

export interface ModelACompactEntity {
  id: ModelAId
  name: string
}

export const ModelAEntityMeta = {
  prismaModel: 'ModelA',
  entityName: 'ModelAEntity',
  fields: {
    id:    { source: 'id',    kind: 'scalar', tsType: 'ModelAId', brand: 'ModelAId' },
    name:  { source: 'name',  kind: 'scalar', tsType: 'string' },
    count: { source: 'count', kind: 'scalar', tsType: 'number' },
  },
  excluded: ['apiKey'],
  secrets:  ['apiKey'],
  variants: {
    Compact: { include: ['id', 'name'] },
  },
} as const

apiKey is omitted from every interface, but recorded in excluded and secrets so audit code (or @nesor/mapper) can still see that it existed.

Why Nesor

  • One file per model. Browse your domain like you browse your features.
  • Schema is the source of truth. Nesor never modifies schema.prisma.
  • Name-agnostic. No hardcoded knowledge of email, password, createdAt. Everything flows from the DMMF and your /// tags.
  • No business logic in emitted code. Mapping a Prisma row to an entity is your job. Use @nesor/mapper for trivial cases or roll your own.
  • Generated files are committed. Diff review is the safety net. Output is deterministic and formatter-friendly.
  • Zero runtime deps in emitted code. Imports point at your enums (configurable) and other entity files — that's it.

CLI

nesor --help            # full subcommand list
nesor init              # bootstrap schema.prisma + add the nesor block
nesor generate          # regenerate entities
nesor watch             # watch + regenerate on schema change
nesor check             # CI-friendly: fail if generated files drift from disk

Any subcommand Nesor doesn't recognise is forwarded straight to the bundled prisma, so nesor migrate dev, nesor studio, nesor format, nesor db pull, etc. all work without leaving the nesor CLI.

Docs

  • CONFIG — every option of the generator block.
  • DSL — every /// tag.
  • VARIANTS — declaring and consuming variants.
  • META — the EntityMeta shape.
  • MAPPER — the optional row-to-entity helper.
  • RECIPES — clean architecture, soft delete, branded IDs, modules.
  • COMPARISON — how Nesor differs from neighbouring tools.

Compatibility

  • Node 20+
  • Prisma 6.x (bundled — pnpm add -D nesor brings it in; you don't install it separately)
  • @prisma/client 6.x is still a runtime dep of your own app

License

MIT