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

create-dzql

v0.6.28

Published

Create a new DZQL application

Readme

{{name}}

A real-time database application powered by DZQL.

Quick Start

# Install dependencies
bun install

# Compile domain and start database
bun run db:rebuild

# Start development servers
bun run dev

The app will be available at:

  • Client: http://localhost:5173
  • Server: http://localhost:3000
  • WebSocket: ws://localhost:3000/ws

Project Structure

├── domain.ts           # Entity definitions and subscriptions
├── tasks.ts            # CLI task runner (invoket)
├── generated/          # Compiled output (after compile)
│   ├── db/migrations/  # SQL migrations
│   ├── runtime/        # Server manifest
│   └── client/         # TypeScript SDK & stores
├── server/             # DZQL server
│   └── index.ts
├── client/             # Vue/Vite frontend
│   └── src/
├── compose.yml         # Docker Compose for PostgreSQL
└── .env                # Environment variables

Development Workflow

Modify the Domain

Edit domain.ts to add entities, permissions, or subscriptions. Then rebuild:

bun run db:rebuild

This compiles the domain and restarts PostgreSQL with a fresh database.

Scripts

| Script | Description | |--------|-------------| | bun run dev | Start server and client in watch mode | | bun run compile | Compile domain.ts to generated/ | | bun run db:up | Start PostgreSQL | | bun run db:down | Stop PostgreSQL and remove data | | bun run db:logs | View database logs | | bun run db:rebuild | Compile + restart database (clean slate) |

CLI Data Operations (invoket)

This project includes invoket for CLI database operations via tasks.ts:

# List available commands
invt --list

# DZQL data operations
invt dzql:entities                          # List all entities
invt dzql:subscribables                     # List all subscribables
invt dzql:functions                         # List all functions
invt dzql:search users                      # Search users
invt dzql:get posts '{"id": 1}'             # Get post by ID
invt dzql:save posts '{"title": "Hello"}'   # Create/update post
invt dzql:delete posts '{"id": 1}'          # Delete post
invt dzql:call login_user '{"email": ".."}' # Call any function

Custom Tasks

Add your own tasks to tasks.ts:

import { Context } from "invoket/context";
import { DzqlNamespace } from "dzql/namespace";

export class Tasks {
  dzql = new DzqlNamespace();

  /** Deploy to production */
  async deploy(c: Context) {
    await c.run("bun run build", { echo: true });
    await c.run("rsync -avz dist/ server:/var/www/app/", { echo: true });
  }
}

Entity Definition

export const entities = {
  posts: {
    schema: {
      id: 'serial PRIMARY KEY',
      title: 'text NOT NULL',
      author_id: 'int REFERENCES users(id)'
    },
    permissions: {
      view: [],                    // Anyone can view
      create: [],                  // Logged-in users can create
      update: ['@author_id'],      // Only author can update
      delete: ['@author_id']       // Only author can delete
    }
  }
};

Subscriptions

Real-time data with automatic updates:

import { usePostDetailStore } from '@generated/client/stores/usePostDetailStore';

const store = usePostDetailStore();
const { data } = await store.bind({ post_id: 1 });

// data is reactive - updates automatically when post or comments change

Docker Playwright Testing

When running Playwright tests from a Docker container, use host.docker.internal instead of localhost to access services running on the host machine:

// In your Playwright test
await page.goto('http://host.docker.internal:5173');

Learn More