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

d-sch-viewer

v0.1.3

Published

Real-time ERD viewer for Prisma schemas with Graphviz layout. Interactive focus mode, auto port management, and live updates.

Readme

d-sch-viewer

Real-time Entity-Relationship Diagram (ERD) viewer for Prisma schemas with professional Graphviz-powered layout.

Watch your database schema come to life as you edit your .prisma files. Changes are reflected instantly in an interactive diagram.

d-sch-viewer screenshot

Features

  • Professional Layout: Uses Graphviz (via WASM) for optimal hierarchical node positioning
  • Real-time updates: See changes as you edit your Prisma schema files
  • Multi-file support: Reads all .prisma files in your schema directory
  • Focus Mode: Click any table to highlight only that table and its direct relations (dims unrelated tables)
  • Interactive Navigation: Zoom, pan, and explore your schema freely
  • Beautiful Bezier curves: Smooth spline connections between tables
  • All fields visible: Tables show all fields with dynamic height
  • Relation visualization: Shows 1:1, 1:N, and N:M relationships with arrows
  • Cross-file relations: Highlights relations between models in different files (orange)
  • Auth models priority: Auth-related models positioned at top of diagram
  • MiniMap: Navigate large schemas easily
  • Dark theme: Easy on the eyes
  • Auto port management: Automatically frees the port if already in use

Installation

npm install -g d-sch-viewer

Or use directly with npx:

npx d-sch-viewer

Or with bun:

bun add -g d-sch-viewer

Usage

Navigate to your project directory (where your Prisma schema is located) and run:

d-sch-viewer

Or use the short alias:

dsch

Then open http://localhost:4567 in your browser.

Options

-p, --port <port>    Port to run the server on (default: 4567)
-d, --path <path>    Path to schema directory (default: ./prisma/schema)
--no-watch           Disable file watching
-o, --open           Open browser automatically
-h, --help           Show help message
-v, --version        Show version number

Examples

# Start with defaults
d-sch-viewer

# Use a different port
d-sch-viewer -p 3333

# Custom schema path
d-sch-viewer -d ./database/prisma

# Open browser automatically
dsch --open

Controls

| Action | Description | |--------|-------------| | Click table | Enter Focus Mode - shows only selected table and its relations | | Click empty space | Exit Focus Mode - shows all tables | | ESC key | Exit Focus Mode | | Scroll wheel | Zoom in/out | | Click + Drag | Pan around the diagram | | Hover table | Highlight related tables (yellow outline) |

Schema Structure

d-sch-viewer expects your Prisma schema to be organized like this:

your-project/
└── prisma/
    └── schema/
        ├── schema.prisma     # Main schema
        ├── auth.prisma       # Auth models (positioned at top)
        └── ...               # Additional schema files

The tool reads all .prisma files in the root of the schema directory (not subdirectories).

Tech Stack

  • Layout Engine: Graphviz via @viz-js/viz (WASM)
  • Parser: @mrleebo/prisma-ast for Prisma schema parsing
  • File Watcher: chokidar for real-time updates
  • Server: Native Node.js HTTP + WebSocket
  • Rendering: Vanilla JavaScript + SVG (no React dependency)

Compatibility

  • Node.js: 18.0.0 or higher
  • Bun: Fully compatible
  • Prisma: Any version with standard schema syntax

Development

# Clone the repository
git clone https://github.com/Daniels9705/d-sch-viewer.git
cd d-sch-viewer

# Install dependencies
bun install

# Run in development mode
cd packages/cli
bun run dev -- -d /path/to/your/prisma/schema -o

Changelog

v0.1.1

  • Focus Mode: Click any table to show only that table and its direct relations
  • Auto port management: Automatically kills existing process on port before starting
  • Improved UX: Drag to pan maintains focus mode, click without drag exits focus mode
  • ESC key support: Press ESC to exit focus mode
  • Removed table dragging (replaced with Focus Mode for better UX)

v0.1.0

  • Initial release
  • Graphviz-powered layout engine
  • Real-time schema watching
  • Multi-file Prisma schema support
  • Interactive zoom/pan navigation
  • MiniMap for large schemas

License

MIT