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

brizzle

v0.3.0

Published

Rails-like generators for Next.js + Drizzle ORM projects

Readme

Rails-like generators for Next.js + Drizzle ORM projects. Generate models, server actions, CRUD pages, and API routes with a single command.

Documentation

Installation

npm install -g brizzle

Or use with npx:

npx brizzle scaffold post title:string body:text

Quick Start

# Initialize Drizzle ORM in your project
npx brizzle init

# Generate a full CRUD scaffold (model + actions + pages)
brizzle scaffold post title:string body:text published:boolean

# Generate just model and actions (no views)
brizzle resource user name:string email:string:unique

# Generate model and REST API routes
brizzle api product name:string price:float

# Generate only a model
brizzle model comment content:text authorId:references:user

# Generate only actions for an existing model
brizzle actions post

Commands

brizzle init

Interactive setup wizard for Drizzle ORM. Configures your database connection and generates all necessary files.

brizzle init

Supports:

  • SQLite: better-sqlite3, libsql (Turso), bun:sqlite
  • PostgreSQL: postgres.js, pg, neon, vercel-postgres
  • MySQL: mysql2, planetscale

Options:

  • --dialect <dialect> - Database dialect for non-interactive mode
  • --driver <driver> - Database driver for non-interactive mode
  • --no-install - Skip automatic dependency installation

brizzle model <name> [fields...]

Creates a Drizzle schema model in db/schema.ts.

brizzle model user name:string email:string:unique
brizzle model post title:string body:text published:boolean
brizzle model order total:decimal status:enum:pending,paid,shipped

brizzle actions <name>

Creates server actions file with CRUD operations.

brizzle actions user

brizzle resource <name> [fields...]

Creates model + actions (no UI pages).

brizzle resource session token:uuid userId:references:user --uuid

brizzle scaffold <name> [fields...]

Creates model + actions + full CRUD pages (list, show, new, edit).

brizzle scaffold product name:string price:float description:text?

brizzle api <name> [fields...]

Creates model + REST API route handlers.

brizzle api webhook url:string secret:string:unique

brizzle destroy <type> <name>

Removes generated files (does not modify schema).

brizzle destroy scaffold post
brizzle destroy api product --dry-run

brizzle config

Shows detected project configuration.

Field Types

| Type | SQLite | PostgreSQL | MySQL | |------|--------|------------|-------| | string | text | text | varchar(255) | | text | text | text | text | | integer / int | integer | integer | int | | bigint | integer | bigint | bigint | | boolean / bool | integer (mode: boolean) | boolean | boolean | | float | real | doublePrecision | double | | decimal | text | numeric | decimal | | datetime / timestamp | integer (mode: timestamp) | timestamp | datetime | | date | integer (mode: timestamp) | date | date | | json | text | jsonb | json | | uuid | text | uuid | varchar(36) |

Special Types

  • enum: status:enum:draft,published,archived
  • references: authorId:references:user

Field Modifiers

  • Nullable: Add ? to make field optional

    brizzle model user bio:text? nickname?
  • Unique: Add :unique modifier

    brizzle model user email:string:unique

Options

| Option | Description | |--------|-------------| | -f, --force | Overwrite existing files | | -n, --dry-run | Preview changes without writing | | -u, --uuid | Use UUID for primary key | | --no-timestamps | Skip createdAt/updatedAt fields |

Auto-Detection

The generator automatically detects your project configuration:

  • Project structure: src/app/ vs app/
  • Path aliases: Reads from tsconfig.json (@/, ~/, etc.)
  • Database dialect: Reads from drizzle.config.ts
  • DB location: Checks db/, lib/db/, server/db/

Run brizzle config to see detected settings.

Example Output

$ brizzle scaffold post title:string body:text published:boolean

Scaffolding Post...

      create  db/schema.ts
      create  app/posts/actions.ts
      create  app/posts/page.tsx
      create  app/posts/new/page.tsx
      create  app/posts/[id]/page.tsx
      create  app/posts/[id]/edit/page.tsx

Next steps:
  1. Run 'pnpm db:push' to update the database
  2. Run 'pnpm dev' and visit /posts

Requirements

  • Node.js >= 18
  • Next.js project with App Router
  • Drizzle ORM configured (or run brizzle init to set it up)

Roadmap

  • [x] Drizzle init - brizzle init to set up Drizzle ORM, database config, and db connection
  • [ ] Authentication - brizzle auth to generate better-auth setup with user model and sign-in/sign-up pages
  • [ ] Zod schemas - Generate validation schemas for forms and API routes
  • [ ] Indexes - Support for name:string:index field modifier
  • [ ] Default values - Support for status:string:default:active
  • [ ] Soft deletes - Add --soft-delete flag for deletedAt timestamp
  • [ ] Pagination - Add pagination to list pages and API routes
  • [ ] Search & filtering - Generate search/filter UI for list pages
  • [ ] Seed generator - brizzle seed <model> to generate seed data files
  • [ ] Relations helper - Better syntax for has-many/belongs-to relationships
  • [ ] Custom templates - Allow overriding templates via .brizzle/ directory
  • [ ] Interactive mode - brizzle new wizard for step-by-step model creation
  • [ ] Import cleanup - Remove unused imports when destroying models

Have a feature request? Open an issue

License

MIT