{"id":16124703,"url":"https://github.com/emilbayes/pg-ipc","last_synced_at":"2025-09-13T15:32:18.114Z","repository":{"id":45965244,"uuid":"80603103","full_name":"emilbayes/pg-ipc","owner":"emilbayes","description":"IPC over PostgreSQL LISTEN/NOTIFY/UNLISTEN exposed as an EventEmitter","archived":false,"fork":false,"pushed_at":"2022-04-05T08:32:30.000Z","size":10,"stargazers_count":31,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-18T17:58:06.316Z","etag":null,"topics":["database","ipc","postgres","pubsub"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emilbayes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-01T08:52:49.000Z","updated_at":"2024-04-27T02:43:18.000Z","dependencies_parsed_at":"2022-09-18T22:11:41.620Z","dependency_job_id":null,"html_url":"https://github.com/emilbayes/pg-ipc","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/emilbayes/pg-ipc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilbayes%2Fpg-ipc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilbayes%2Fpg-ipc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilbayes%2Fpg-ipc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilbayes%2Fpg-ipc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emilbayes","download_url":"https://codeload.github.com/emilbayes/pg-ipc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilbayes%2Fpg-ipc/sbom","scorecard":{"id":375450,"data":{"date":"2025-08-11","repo":{"name":"github.com/emilbayes/pg-ipc","commit":"213bed095cc7677d3bc4de8bd00dfe54e826801f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 1/11 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T14:09:22.893Z","repository_id":45965244,"created_at":"2025-08-18T14:09:22.893Z","updated_at":"2025-08-18T14:09:22.893Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274983600,"owners_count":25385459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","ipc","postgres","pubsub"],"created_at":"2024-10-09T21:23:09.747Z","updated_at":"2025-09-13T15:32:17.845Z","avatar_url":"https://github.com/emilbayes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `pg-ipc`\n\n\u003e IPC over PostgreSQL LISTEN/NOTIFY/UNLISTEN exposed as an EventEmitter\n\n## Usage\n\n```js\nvar pgIPC = require('pg-ipc')\nvar client = new require('pg').Client({ ... })\n\nvar ipc = pgIPC(client)\n\nipc.on('error', console.error)\n\nipc.on('end', function () {\n  client.end()\n})\n\nipc.on('someChannel', function (msg) {\n  // Ignore messages from this process\n  if (msg.processId === client.processID) return\n  console.log(msg.payload.currentTime)\n})\n\nipc.notify('someChannel', {currentTime: Date.now()})\n\n// some time later ...\n\nipc.end()\n\n```\n\n## API\n\n### `pgIPC(client)`\n\nInstantiates a new `EventEmitter` with the appropriate hooks to automatically\n`LISTEN`/`NOTIFY`/`UNLISTEN`. Note that `client` must be a `pg.Client` instance\nand not a `pg.Pool`, as a single connection is required.\n\n### `ipc.on(channel, listener)`\nAll the standard `EventEmitter` methods are exposed. When a listener is added to\n`channel`, a `LISTEN` command is automatically issued, and `UNLISTEN` when the\nnumber of listeners reach zero. The listener will receive the message as its\nfirst argument. Notable properties being `channel`, `payload`, `processId`. Each\npostgres `connection` is assigned a unique `processId`, which can be used to\nignore messages from the same process.\nSee [`EventEmitter`](https://nodejs.org/api/events.html) for more details.\nReserved channels are:\n`['newListener', 'removeListener', 'notify', 'unlisten', 'listen', 'error', 'end']`\n\n### `ipc.notify(channel[, payload])`\nAlias: `ipc.send(channel[, payload])`. Send a message to `channel` with optional\n`payload`. `payload` is transparently converted to JSON where appropriate.\n\n### `ipc.end()`\nIssue `UNLISTEN *` if connected, emit `end` and detach all event listeners.\nDoes not call `client.end()` so you can continue using the client. However,\nany listeners you've issued outside outside of this module will also be detached\n\n### Event: `listen`\n\nEmitted when a `LISTEN` has been successfully issued. Passed `channel`\n\n### Event: `notify`\n\nEmitted after a notification has been successfully sent. Passed `channel` and `payload`\n\n### Event: `unlisten`\n\nEmitted when a `UNLISTEN` has been successfully issued. Passed `channel`\n\n### Event: `end`\n\nEmitted when all `LISTEN`s have been removed, but before all event listeners are removed.\n\n### Event: `error`\n\nPropagates any errors caused by queries on `Client`. Passed the `err` argument from\nthe query callback.\n\n## Install\n\n```sh\nnpm install pg-ipc\n```\n\n## License\n\n[ISC](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femilbayes%2Fpg-ipc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femilbayes%2Fpg-ipc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femilbayes%2Fpg-ipc/lists"}