Comparing version 0.0.7 to 0.0.8
{ | ||
"name": "pg-notify", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Postgres pubsub client", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -31,2 +31,21 @@ <h1 align="center">Welcome to pg-notify 👋</h1> | ||
## Usage | ||
```js | ||
const PGPubSub = require('pg-notify') | ||
// import PGPubSub from 'pg-notify | ||
;(async () => { | ||
const pubsub = new PGPubSub({ | ||
db: { connectionString: 'postgres://postgres:postgres@localhost:5432/db' } | ||
}) | ||
await pubsub.connect() | ||
await pubsub.on('test', (payload) => { | ||
console.log('payload: ', payload) | ||
}) | ||
await pubsub.emit({ topic: 'test', payload: 'this is the payload' }) | ||
})() | ||
``` | ||
## Contributing | ||
@@ -33,0 +52,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12949
59