Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Postgres PubSub client using NOTIFY/LISTEN
npm install pg-notify
yarn add pg-notify
pnpm add pg-notify
PGPubSub accepts the same config as pg.
import PGPubSub from 'pg-notify'
//const PGPubSub = require('pg-notify')
;(async () => {
const pubsub = new PGPubSub({
connectionString: 'postgres://postgres:postgres@localhost:5432/db'
})
await pubsub.connect()
await pubsub.on('test', (payload) => {
console.log('payload: ', payload)
})
await pubsub.emit('test', 'this is the payload')
await pubsub.emit('test', { foo: 'bar' })
await pubsub.close()
})()
options
(object
) Configuration options for pg-notify pubsub instance. Accepts same options as pg with few custom ones described below.
number
) Maximum number of reconnect attempts after losing connection. Pass 0
to disable reconnecting. Default: 10
.number
) Maximum payload size, exceeding given size will throw an error. Default: 7999
(In the default configuration it must be shorter than 8000 bytes.).channel
(string
)payload
(string
or object
)channel
(string
)listener
(function
accepting single argument payload
)listener
(function
accepting single argument payload
)Contributions, issues and feature requests are welcome!
Copyright © 2020 Aldis Ameriks.
This project is MIT licensed.
FAQs
Postgres pubsub client
The npm package pg-notify receives a total of 1,558 weekly downloads. As such, pg-notify popularity was classified as popular.
We found that pg-notify demonstrated a healthy version release cadence and project activity because the last version was released less than 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.