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.

Official PostgreSQL Parser

Uses the real PostgreSQL C parser via WebAssembly

Cross-Platform

Runs on macOS, Linux, Windows, Node.js & browsers

No Native Builds

WebAssembly means no compilation headaches

libpg-query Features

Production-grade PostgreSQL parsing with WebAssembly power

Official PostgreSQL Parser

Uses the actual PostgreSQL C parser compiled to WebAssembly, ensuring 100% spec-accurate parsing.

Universal Cross-Platform Support

Runs smoothly on macOS, Linux, Windows, Node.js, and browsers with consistent behavior everywhere.

Zero Native Dependencies

No compilation, no system-specific dependencies, no node-gyp headaches - just install and run.

Multi-Version PostgreSQL Support

Supports PostgreSQL versions 13, 14, 15, 16, and 17 with runtime version selection capabilities.

Production-Grade Reliability

Millions of downloads and trusted by countless projects and top teams for mission-critical applications.

Complete TypeScript Support

Full TypeScript definitions for all PostgreSQL versions with comprehensive type safety and IntelliSense.