Easy PG Scanner (v1.0.9) is a Node.js package for reading PostgreSQL database schemas into a structured array. It retrieves tables, columns, functions, triggers, indexes, check constraints, and foreign keys in a single asynchronous call. Currently in early release with monthly updates. Alternative to tools like pg-structure, with a simpler API and no external dependencies beyond pg. Ships TypeScript types.
npm install easy-pg-scannerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates connecting to a PostgreSQL database and fetching its full schema as a structured array using loadDatabase.
Set 'type': 'module' in package.json or rename file to .mjs. For CJS, use const loadDatabase = (await import('easy-pg-scanner')).default;Ensure all required connection fields (host, port, user, password, database) are provided and valid. Use try-catch around the call.
Monitor GitHub releases; adapt code when property name changes.
Query raw information_schema if you need original casing.
Add "type": "module" to package.json or rename the file to .mjs.
Use const loadDatabase = require('easy-pg-scanner').default;Double-check password in connection options and ensure pg_hba.conf allows password authentication.
Check the host field in connection options; ensure database server is reachable.