Registry / database / errsole-postgres

errsole-postgres

JSON →
library3.0.0jsnpmunverified

PostgreSQL storage plugin for Errsole, a Node.js logger with a built-in web dashboard. Current version is 3.0.0, released as stable. It allows storing application logs in PostgreSQL, integrating with the Errsole ecosystem. Key differentiator: direct log storage in PostgreSQL, leveraging existing database infrastructure. The package ships TypeScript types and uses CommonJS/ESM. Release cadence is not specified, but follows Errsole main package. Note: This is a plugin; requires the main 'errsole' package to function.

npm install errsole-postgres
INSTALL
IMPORT
SIG · ERRSOLE-POSTGRES
E
errsole-postgres
databasejavascriptv3.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ErrsolePostgres
✓ import { ErrsolePostgres } from 'errsole-postgres'
✗ const ErrsolePostgres = require('errsole-postgres').ErrsolePostgres
ESM named export. CommonJS: const { ErrsolePostgres } = require('errsole-postgres')
ErrsolePostgres (default)
✓ import ErrsolePostgres from 'errsole-postgres'
✗ const ErrsolePostgres = require('errsole-postgres')
Default export available in ESM. CommonJS: const ErrsolePostgres = require('errsole-postgres').default
type ErrsolePostgresConfig
✓ import type { ErrsolePostgresConfig } from 'errsole-postgres'
TypeScript only, no runtime value

Initializes Errsole with PostgreSQL storage plugin and logs a message.

import { Errsole } from 'errsole'; import { ErrsolePostgres } from 'errsole-postgres'; const errsole = new Errsole({ storage: new ErrsolePostgres({ host: process.env.PGHOST ?? 'localhost', port: parseInt(process.env.PGPORT ?? '5432', 10), database: process.env.PGDATABASE ?? 'mydb', user: process.env.PGUSER ?? 'user', password: process.env.PGPASSWORD ?? 'password', }), }); errsole.info('Application started');
Debug
Known issues
gotchaerrsole-postgres requires a running PostgreSQL instance. Ensure connection parameters are correct before logging.
fix
Verify PostgreSQL connection with environment variables; test using a simple SELECT 1.
affects: >=1.0.0
gotchaThe ErrsolePostgres constructor throws if connection fails; no fallback to alternative storage.
fix
Wrap initialization in try-catch or ensure database is accessible.
affects: >=3.0.0
deprecatedIn v3, the default export is deprecated in favor of named export; default export remains for backward compatibility.
fix
Use named import '{ ErrsolePostgres }' instead of default import.
affects: >=3.0.0
breakingv3 changed the import path: previously required 'errsole-postgres/dist/index'.
fix
Update import to 'errsole-postgres' directly.
affects: <3.0.0
Errors
Common errors & fixes
Error: Cannot find module 'errsole-postgres'
Module not installed or wrong version
fix
npm install errsole-postgres@latest
TypeError: ErrsolePostgres is not a constructor
Using default import incorrectly in CommonJS or ESM
fix
Use named import: const { ErrsolePostgres } = require('errsole-postgres'); or import { ErrsolePostgres } from 'errsole-postgres';
ECONNREFUSED :5432 - connection refused
PostgreSQL not running or host/port incorrect
fix
Start PostgreSQL or update connection config
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies
errsolerequiredCore logger library; errsole-postgres is a storage plugin for Errsole
Agent activity
10 hits · last 30 days
node
10
Resources
errsole-postgres — npm install errsole-postgres · libregistry