# PGlite

A WebAssembly build of Postgres packaged as a TypeScript client library, letting an application run Postgres directly in the browser, Node.js, Bun, or Deno with no other dependencies to install.

PGlite compiles Postgres to WebAssembly and packages it as a small TypeScript client library, about 3 MB gzipped, that runs the database in-process rather than as a separate server. It supports many Postgres extensions, including pgvector and PostGIS, and can be used as an ephemeral in-memory database or persisted to the file system in Node, Bun, and Deno, or to IndexedDB in the browser.

Because WebAssembly builds compiled with Emscripten cannot fork new processes, PGlite relies on Postgres's single-user mode rather than the usual per-connection process model, which is why it runs as an embedded library instead of a client-server database.

It is written in TypeScript and released under the Apache-2.0 license.

Website: https://pglite.dev
