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

orm2erd

v1.2.1

Published

Generate ERD diagrams (Mermaid, DBML, PlantUML, D2) straight from your ORM's models/schema — no manual diagramming.

Readme

orm2erd

You already built the app — your ORM models are the schema. orm2erd reads them and generates an ERD (Entity-Relationship Diagram) for you, instead of you drawing and maintaining one by hand.

Status: early development — see the tables below for what's supported today vs. planned.

orm2erd demo

What it does

orm2erd scans your project, figures out which ORM you're using, and turns your existing models/schema into diagram code — Mermaid, DBML, PlantUML, D2, and more. No manual diagramming, no drift between your code and your docs.

detect ORM → resolve entry point(s) → parse/introspect → normalize to IR → emit diagram code(s) → write file(s)

Supported ORMs

| | ORM | Status | | --- | --- | --- | | | Prisma | ✅ Supported | | | Sequelize | ✅ Supported | | | TypeORM | 🚧 Planned | | | Drizzle | 🚧 Planned |

Output formats

| | Format | Status | | --- | --- | --- | | | Mermaid | ✅ Supported | | | DBML | ✅ Supported | | | PlantUML | 🚧 Planned | | | D2 | 🚧 Planned |

Installation

Run without installing (recommended — always gets the latest version):

npx orm2erd

Or install globally:

npm i -g orm2erd
orm2erd

Usage

Interactive:

npx orm2erd
┌  orm2erd
│
◇  Detected: prisma
◆  Entry point for prisma:
│  prisma/schema.prisma
◆  Output format(s):
│  mermaid
◆  Output path:
│  erd.mermaid
◆  Type labels:
│  Canonical
│
◇  Written to erd.mermaid
│
└  Done

Non-interactive (CI-friendly):

npx orm2erd --orm prisma --entry ./prisma/schema.prisma --format mermaid,dbml --out ./erd

You can select multiple output formats in a single run — the schema is parsed once and reused across every format you pick. --out accepts either a bare name (erd, gets each format's extension appended) or a full filename (erd.md, used exactly as given when there's only one output format).

By default, field types are emitted in a canonical, portable form (e.g. string, int). Pass --type-mode native to emit the ORM's own type names instead (e.g. Prisma's String, Int):

npx orm2erd --orm prisma --entry ./prisma/schema.prisma --format mermaid --type-mode native

Why

Diagrams drawn by hand go stale the moment the schema changes. Your ORM already has an accurate, structured picture of your data model — orm2erd just reads that instead of asking you to redraw it.

Contributing

See CLAUDE.md for architecture, the adapter/emitter contract, and design decisions.

License

MIT