pg-camelcase is a lightweight utility (v0.0.3, no active release schedule) that monkey-patches the pg (node-postgres) library to automatically convert PostgreSQL result field names from snake_case to camelCase. It provides a simple `inject(pg)` function that returns an undo function, and a standalone `camelCase(str)` helper. Differentiators: minimal API, no dependencies, and reversible injection. However, the package is in an early, possibly abandoned state with no recent updates or TypeScript support.
npm install pg-camelcaseNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to inject camelCase conversion into pg, use it, and revert.
Pin pg version or consider alternative packages that use hooks.
Add a manual declaration file or use a type assertion.
Consider forking or using pg-format with custom row parser.
Use a more comprehensive transformation if nested keys are needed.
Call revert() after each set of queries that need camelCase, or scope usage carefully.
Use the correct import for your module system: const { inject } = require('pg-camelcase') for CJS.Run npm install pg-camelcase and ensure name is correct.
Pass the entire pg module: inject(require('pg')).No dependency data recorded yet.