libpg-query
The Real PostgreSQL Parser for JavaScript
Node.js bindings for libpg_query, converting SQL into parse trees. The official PostgreSQL parser compiled to WebAssembly for seamless, cross-platform compatibility in Node.js and browsers.
Uses the real PostgreSQL C parser via WebAssembly
Runs on macOS, Linux, Windows, Node.js & browsers
WebAssembly means no compilation headaches
Production-grade PostgreSQL parsing with WebAssembly power
Uses the actual PostgreSQL C parser compiled to WebAssembly, ensuring 100% spec-accurate parsing.
Runs smoothly on macOS, Linux, Windows, Node.js, and browsers with consistent behavior everywhere.
No compilation, no system-specific dependencies, no node-gyp headaches - just install and run.
Supports PostgreSQL versions 13, 14, 15, 16, and 17 with runtime version selection capabilities.
Millions of downloads and trusted by countless projects and top teams for mission-critical applications.
Full TypeScript definitions for all PostgreSQL versions with comprehensive type safety and IntelliSense.