pg-error-enum

JSON →
library 2.0.1 ·javascript
verified Jun 5, 2026

TypeScript Enum for Postgres Error Codes. Version 2.0.1 provides generated TypeScript enums mapping all PostgreSQL error codes to their SQLSTATE values, with zero runtime dependencies. Updated from the PostgreSQL errcodes.txt source. Supports ESM and CommonJS. Ideal for type-safe error handling in Node.js with the 'pg' library, eliminating magic strings.