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

zerx.js

v0.1.0-beta.1

Published

Zerx — The Universal Application Contract Engine

Readme

Zerx Engine

The Universal Application Contract Engine

License: MIT TypeScript Node.js

🚀 What makes Zerx special?

Modern app development is fragmented: you write Prisma schemas for your DB, Express/Fastify routes for your API, Casbin/CASL rules for authorization, and React Query hooks for the frontend.

Zerx solves this by moving everything into the Contract.

With Zerx, you define your models once. The Zerx AOT Compiler statically parses your TypeScript definitions and generates:

  1. High-Performance SQL Migrations & DB Schema.
  2. Zero-Config REST API Routes with automatic caching & rate limiting.
  3. Robust AuthZ Policies evaluated before any data is touched.
  4. End-to-End Type-Safe Frontend Hooks (React + SDK).

✨ Killer Features

🛡️ Unified Engine Architecture

Define Models, Validation, Relations, and Permissions in one elegant chainable API.

export const Post = z.model('Post', {
  id: z.id(),
  title: z.string().min(1).max(200),
  author: z.belongsTo('User'),
  tags: z.manyToMany('Tag'),
})
.access({
  read: () => true, // Publicly readable
  create: (_, ctx) => ctx.auth !== null, // Must be logged in
  update: (post, ctx) => ctx.auth?.id === post.authorId, // Owner only
  delete: (post, ctx) => ctx.auth?.role === 'admin', // Admin only
})
.api({
  list: { paginate: true, cache: '1m' },
});

⚡ AOT Compiler (No Runtime Overhead)

Unlike other frameworks that generate routes heavily at runtime, zerx generate executes an Ahead-of-Time (AOT) compilation step. It parses the AST of your contract and generates raw, lightning-fast Fastify controllers and optimized SQL statements.

🗄️ Automated Migrations Engine

Stop writing DDL by hand. Run zerx migrate create and Zerx diffs your current Contract against its snapshot history to emit precise SQLite/PostgreSQL ALTER TABLE statements, including foreign key constraints and synthetic join-tables for manyToMany relations.

🎨 Zerx Studio (Premium Admin Dashboard)

Run zerx studio to instantly get a Vercel/Tailwind-inspired premium management dashboard:

  • Data Explorer: Visualize, Filter, Sort, and mutate your data.
  • Rules Visualizer: Debug your access() rules visually with exact reason matching (e.g. "Denied by rule: delete requires admin").
  • Migration Manager: See real-time database schema states.
  • SQL Editor: Run raw SQL queries directly from your browser.
  • Relation Badges & Smart Empty States: A UI that feels like magic.

🔌 Fully Ejectable & Modular

You're never locked in. The generated artifacts(.zerx/server, .zerx/client) are formatted, highly-readable TypeScript files. At any point, you can take the generated Fastify app and Prisma-like generic DB client and build upon them yourself.


🛠️ Quick Start

# 1. Initialize a new Zerx Project
npx zerx init my-app
cd my-app

# 2. Generate the Artifacts (Server, Client, Migrations)
npx zerx generate all

# 3. Apply the Database Migrations
npx zerx migrate run

# 4. Start the Development Server
npx zerx dev

# 5. Open the Admin Studio
npx zerx studio

📦 Packages

Zerx is managed as a Monorepo using pnpm and turborepo.

| Package | Description | | :--- | :--- | | zerx/core | The core z DSL builder, Models, and Engine APIs. | | zerx/compiler | AOT AST Parser, Code Generators, and Migration Diff Engine. | | zerx/cli | The zerx command line interface for developers. | | zerx/server | Fastify-based backend runtime and route adapters. | | zerx/client | The Frontend SDK & React hooks. | | zerx/authz | The standalone dynamic Policy Enforcement Engine. | | zerx/db | High-performance query builder and SQLite driver. | | zerx/studio | The React-based Premium Admin Dashboard. |


🏗️ Architecture

  1. Phase 1 (Design): You write z.model() contracts.
  2. Phase 2 (Compile): zerx/compiler reads the TS AST, produces a ContractIR (Intermediate Representation).
  3. Phase 3 (Generate): Generators spin out SQL Migrations, OpenAPI specs, Fastify routes, and React clients.
  4. Phase 4 (Runtime): zerx/server mounts the artifacts dynamically alongside the zerx/authz engine check logic.

🤝 Contributing

Contributions are welcome! Please read our Contributing Guidelines and check out the open issues.

📝 License

Zerx is open-sourced software licensed under the MIT license.