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

prisma-pglite-bridge

v1.1.0

Published

In-process PGlite bridge for Prisma — zero-TCP, zero-Docker PostgreSQL

Readme

prisma-pglite-bridge

In-process PGlite bridge for Prisma. Replaces the TCP socket in pg.Client with a Duplex stream that speaks PostgreSQL wire protocol directly to PGlite's WASM engine.

Install

Requires Prisma 7+ and Node.js 20+.

pnpm add -D prisma-pglite-bridge @electric-sql/pglite @prisma/adapter-pg pg

The last three are peer dependencies you may already have. TypeScript users also need @types/pg.

Quickstart

import { PGliteBridge, pushMigrations } from 'prisma-pglite-bridge';
import { PrismaClient } from '@prisma/client';
import seed from './seed.ts'; // user-provided: (prisma: PrismaClient) => Promise<void>

const bridge = new PGliteBridge();
// Have prisma/migrations/? Use pushMigrations (shown).
// Only schema.prisma? Use pushSchema instead — see docs/api.md.
await pushMigrations(bridge.pglite, { migrationsPath: './prisma/migrations' });

const prisma = new PrismaClient({ adapter: bridge.adapter });
await seed(prisma);
await bridge.snapshotDb();

beforeEach(() => bridge.resetDb());

snapshotDb() captures the seeded state once. resetDb() in beforeEach then restores each test to that snapshot — fast, deterministic, no re-seeding per test. Skip the snapshot/reset pair if your tests are read-only or you want state to carry over.

That's it. Run prisma migrate dev first to generate migration files. No Docker, no database server — works in GitHub Actions, GitLab CI, and any environment where Node.js runs.

For projects without a prisma/migrations directory (test fixtures, prototypes), see Populating the database for the pushSchema alternative.

Running the Prisma CLI against this bridge (shadow DB for migrate dev, psql, SQL GUIs)? See PGliteServer for the TCP/Unix-socket front.

Documentation

  • API reference — exports, options, return values, fs-sync policy.
  • Cookbook — Vitest / Jest setup, per-test isolation, seed sharing, extensions, persistent dev database, clean shutdown.
  • PGliteServer — TCP / Unix-socket front for PGlite. Use for the Prisma CLI shadow database, psql, and SQL GUIs.
  • Stats and diagnosticsstats() snapshots and node:diagnostics_channel event streams.
  • Troubleshooting & limitations — known issues (PGlite version mismatch, WASM ExperimentalWarning) and runtime constraints.

License

MIT