
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
postgres-ipc
Advanced tools
PG-Client wrapper for making NOTIFY/LISTEN/UNLISTEN queries. Exposed as async functions or as EventEmitter (continuation of pg-ipc).
PG-Client wrapper for making NOTIFY/LISTEN/UNLISTEN queries. Exposed as async functions and as an EventEmitter (continuation of pg-ipc).
See more about Postgres notifications here: https://www.postgresql.org/docs/15/libpq-notify.html
import PostgresIPCClient from 'postgres-ipc'
// const PostgresIPCClient = require('postgres-ipc')
// Same constructor as Client form pg but defaults to process.env.POSTGRES_CONN_URI
const ipc = new PostgresIPCClient(process.env.POSTGRES_CONN_URI)
// You can add listeners before connecting.
ipc.on("channel-name", (notification) => {
if (notification.processId === ipc.processId) return // Ignore notifications sent by this client like this.
console.log(notification.payload.message)
})
// Once connected it will auto query 'LISTEN channel-name' since you added this listener here.
// Haven't connected yet? No problem... This NOTIFY query will automatically be sent once you connect.
ipc.emit("channel-name", { message: "hello" })
// Basically the same thing but this is awaitable, will return the error (not throw it)
// and already logs the error to console.error for you.
ipc.notify("channel-name", { message: "hello" })
// This is a deprecated alias for notify bcs pg-ipc had this.
ipc.send("channel-name", { message: "hello" })
// Remember to connect ;)
ipc.connect().then(async () => {
// once destroyed you can't connect again
await ipc.destroy()
// also feel free to call this as many times as you feel fit
await ipc.destroy()
})
// You can call connect as many times as your heart desires.
ipc.connect()
import PostgresIPCClient from 'postgres-ipc'
// const PostgresIPCClient = require('postgres-ipc')
const ipc = new PostgresIPCClient()
ipc.connect().then(async () => {
// Otherwise blocked channels like error and debug can be listened for like this
await ipc.listen("channel1", "error")
await ipc.listen(["channel2", "debug", "end"])
// and captured like this
ipc.on("notification", (notification) => {
if (notification.channel === "error") console.log("Notification on error channel!", notification.payload)
})
await ipc.unlisten("channel2", "debug", "end")
await ipc.unlisten(["channel1", "error"])
await ipc.unlisten() // (Unlisten to all)
console.log(ipc.channels()) // These are the channels you are currently listening for.
await ipc.notify(
"IMPORTANT",
"Remember this won't throw an error, it will return an error that has already been logged."
)
await ipc.destroy()
})
ipc.on('notification', (notification) => console.log("Notification from any channel!", notification))
ipc.on('notify', (channel, payload) => console.log("A PG NOTIFY query was successfully made!", channel, payload))
ipc.on('debug', (message) => console.log("See exactly what's happening:", message))
// console.error is already added as a default error handler. You can overwrite it though by adding your own listener:
ipc.on('error', (err) => console.log("One of your listeners threw an error:", err))
ipc.on('end', () => console.log("I was once connected but I got destroyed :("))
npm install postgres-ipc
FAQs
PG-Client wrapper for making NOTIFY/LISTEN/UNLISTEN queries. Exposed as async functions or as EventEmitter (continuation of pg-ipc).
The npm package postgres-ipc receives a total of 1 weekly downloads. As such, postgres-ipc popularity was classified as not popular.
We found that postgres-ipc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.