Registry / database / pglistend

pglistend

JSON →
library0.2.1-0jsnpmunverified

pglistend is a lightweight Postgres LISTEN daemon built on node-postgres and systemd. It runs as a background process that listens on configured database channels and executes custom actions (e.g., scripts) upon receiving NOTIFY signals. Version 0.2.1-0 is the latest stable release (as of 2022). The package provides a CLI tool and systemd service integration for Linux. It is designed for projects that leverage PostgreSQL's LISTEN/NOTIFY for event-driven workflows, offering a simple, generic alternative to heavier pub/sub systems.

npm install pglistend
INSTALL
IMPORT
SIG · PGLISTEND
P
pglistend
databasejavascriptv0.2.1-0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Global install, daemon setup, config, start service, and view logs.

sudo npm install -g pglistend sudo pglisten setup-daemon # Edit /etc/pglistend/config.yml sudo systemctl start pglistend sudo journalctl -u pglistend -f
Debug
Known issues
gotchaRequires root/sudo for daemon setup and systemd service management; running without sudo fails.
fix
Use sudo for setup and systemctl commands.
affects: all
gotchaConfiguration file must be named .pglistend.yml in home directory or specified via --config; default path is /etc/pglistend/config.yml.
fix
Ensure config file exists at /etc/pglistend/config.yml or use --config flag.
affects: all
gotchaDaemon runs only on Linux systems with systemd (not macOS/Windows).
fix
Use Linux with systemd, or run manually via npm start on other OS.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'pg'
Missing pg dependency when running script outside of global install
fix
Install pg alongside pglistend: npm install -g pglistend pg
Error: listen EADDRINUSE :::5432
Default PostgreSQL port 5432 already in use
fix
Check if PostgreSQL is running, or change port in config.yml
fatal: database "mydb" does not exist
Database specified in config doesn't exist
fix
Create the database in PostgreSQL before starting pglistend
Upgrade
Version history
0.2.1-0latest on npm
Audit
Dependencies
pgrequirednode-postgres client for PostgreSQL connection
js-yamlrequiredparse YAML configuration file
Agent activity
2 hits · last 30 days
node
2
Resources
pglistend — npm install pglistend · libregistry