16.0k stars · Apache-2.0 (parts under the PostgreSQL licence) · @electric-sql/pglite@0.5.8 (2026-08-26), read from /releases/latest and confirmed on registry.npmjs.org
The real PostgreSQL engine compiled to WebAssembly, so it runs inside a JavaScript program or a browser tab with no server at all.
▶Repo detailsthe review · specs · pros & cons · install
What it is
The real PostgreSQL engine, built to run as WebAssembly (a format that lets a program written in another language run inside JavaScript). It runs in Node.js, in Bun, and in a browser tab. Data can live only in memory, or it can be saved to a file or to the browser's own storage.What it is good for. Two jobs, and both are real. The first is testing: instead of starting a database server before your tests, each test gets its own fresh empty database in milliseconds, and no test can leave dirt behind for the next one. The second is demonstrations: a product can run entirely in a visitor's browser with no account and no backend, and that makes a very persuasive front page.For Grasppy there is a genuine use. Grasppy already runs on PostgreSQL. A public demo where a visitor pastes a long chat and sees the map appear, without signing up and without touching the server, would run on this and cost nothing per visitor.
- A fresh database in milliseconds, so tests stop sharing state.
- It is real PostgreSQL, not an imitation, so the same SQL works in production.
- It supports extensions, including pgvector for similarity search.
- One connection at a time. This is not a replacement for your production server.
- The browser version downloads a few megabytes of WebAssembly on first visit. Plan for that on a slow connection.
- It is driven from JavaScript or TypeScript. A Python backend cannot use it directly, so for Grasppy it belongs in the front end and in the JavaScript tests, not in FastAPI.
npm install @electric-sql/pglite

