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 🙏

© 2025 – Pkg Stats / Ryan Hefner

rusterd

v0.1.1

Published

ER diagram DSL compiler - render ERD to SVG

Readme

rusterd

ER diagram DSL compiler that renders to SVG. Written in Rust, compiles to WASM for browser use.

Features

  • Entities: Define tables with typed columns
  • Column types: int, string, decimal, timestamp, boolean, text
  • Constraints: pk, fk -> Entity.column, not null, unique
  • Relationships: Support all cardinalities (1, *, 0..1, 1..*)
  • Self-references: Entities can reference themselves
  • Layout hints: Grid-based positioning with @hint.arrangement
  • Views: Filter diagrams with view blocks
  • Detail levels: Control what's shown (tables only, pk, pk+fk, all columns)

Example

@hint.arrangement = {
    User;
    Order OrderItem;
    Product
}

entity User {
    id int pk
    email string unique not null
    name string
}

entity Order {
    id int pk
    user_id int fk -> User.id
    total decimal
}

entity Product {
    id int pk
    name string not null
    price decimal
}

entity OrderItem {
    order_id int pk fk -> Order.id
    product_id int pk fk -> Product.id
    quantity int not null
}

rel {
    User 1 -- * Order
    Order 1 -- * OrderItem
    Product 1 -- * OrderItem
}

view simple {
    include User, Order
}

CLI Usage

# Build
cargo build --release

# Render to file
rusterd input.erd -o output.svg

# Render specific view
rusterd input.erd -v simple -o output.svg

# Control detail level
rusterd input.erd -d pk_fk -o output.svg

Detail levels:

  • tables - Entity names only
  • pk - Primary keys
  • pk_fk - Primary and foreign keys
  • all - All columns (default)

WASM Usage

# Build
wasm-pack build --target web

# Run demo
cd demo
bun install
bun run dev
import init, { erdToSvg } from 'rusterd';

await init();
const svg = erdToSvg(erdSource);           // Full diagram
const svg = erdToSvg(erdSource, 'simple'); // Specific view
const svg = erdToSvg(erdSource, null, 'pk_fk'); // Detail level

Syntax Reference

Entities

entity EntityName {
    column_name type [constraints]
}

Relationships

rel {
    Entity1 cardinality -- cardinality Entity2 [: "label"]
}

Cardinalities: 1, *, 0..1, 1..*

Layout Hints

# Grid-based arrangement (semicolons separate rows)
@hint.arrangement = {
    Entity1 Entity2;
    Entity3 Entity4
}

# Entity-specific level hint
entity EntityName @hint.level = 2 {
    ...
}

Views

view view_name {
    include Entity1, Entity2, Entity3
}

Examples

See examples/ directory for more samples including:

  • Many columns layout
  • Deep hierarchies
  • Dense relationships
  • Unicode/CJK text
  • Self-referential entities
  • Complex e-commerce schema

License

MIT