{"id":13402398,"url":"https://github.com/timgit/pg-boss","last_synced_at":"2026-02-11T00:05:23.903Z","repository":{"id":37271138,"uuid":"52692900","full_name":"timgit/pg-boss","owner":"timgit","description":"Queueing jobs in Postgres from Node.js like a boss","archived":false,"fork":false,"pushed_at":"2026-01-23T23:42:12.000Z","size":2436,"stargazers_count":3116,"open_issues_count":37,"forks_count":219,"subscribers_count":20,"default_branch":"master","last_synced_at":"2026-01-24T08:53:16.859Z","etag":null,"topics":["job","node","nodejs","postgres","postgresql","queue"],"latest_commit_sha":null,"homepage":"https://timgit.github.io/pg-boss/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timgit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"timgit"}},"created_at":"2016-02-27T22:55:12.000Z","updated_at":"2026-01-23T23:52:29.000Z","dependencies_parsed_at":"2022-07-12T05:18:28.456Z","dependency_job_id":"134308f7-4556-419d-926a-90b9e6d8cc2d","html_url":"https://github.com/timgit/pg-boss","commit_stats":{"total_commits":804,"total_committers":54,"mean_commits":14.88888888888889,"dds":"0.26119402985074625","last_synced_commit":"463f2fc892895b7d0c14e91574c66e4e565b1638"},"previous_names":[],"tags_count":178,"template":false,"template_full_name":null,"purl":"pkg:github/timgit/pg-boss","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timgit%2Fpg-boss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timgit%2Fpg-boss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timgit%2Fpg-boss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timgit%2Fpg-boss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timgit","download_url":"https://codeload.github.com/timgit/pg-boss/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timgit%2Fpg-boss/sbom","scorecard":{"id":885973,"data":{"date":"2025-08-11","repo":{"name":"github.com/timgit/pg-boss","commit":"6d4c88633285d08311efb99fd6efe6ad04d2f41f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.6,"checks":[{"name":"Code-Review","score":3,"reason":"Found 10/28 approved changesets -- score normalized to 3","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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"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":"Maintained","score":10,"reason":"7 commit(s) and 18 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"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":"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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/timgit/pg-boss/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/timgit/pg-boss/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/timgit/pg-boss/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/timgit/pg-boss/ci.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:39","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 20 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"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T10:03:55.294Z","repository_id":37271138,"created_at":"2025-08-24T10:03:55.294Z","updated_at":"2025-08-24T10:03:55.294Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28863358,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T22:56:21.783Z","status":"online","status_checked_at":"2026-01-29T02:00:06.714Z","response_time":59,"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":["job","node","nodejs","postgres","postgresql","queue"],"created_at":"2024-07-30T19:01:15.512Z","updated_at":"2026-02-11T00:05:23.862Z","avatar_url":"https://github.com/timgit.png","language":"TypeScript","readme":"Queueing jobs in Postgres from Node.js like a boss.\n\n[![NPM](https://nodei.co/npm/pg-boss.svg?style=shields\u0026color=blue)](https://nodei.co/npm/pg-boss/)\n[![Build](https://github.com/timgit/pg-boss/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/timgit/pg-boss/actions/workflows/ci.yml)\n[![Coverage Status](https://coveralls.io/repos/github/timgit/pg-boss/badge.svg?branch=master)](https://coveralls.io/github/timgit/pg-boss?branch=master)\n\n```js\nasync function readme() {\n  const { PgBoss } = require('pg-boss');\n  const boss = new PgBoss('postgres://user:pass@host/database');\n\n  boss.on('error', console.error)\n\n  await boss.start()\n\n  const queue = 'readme-queue'\n\n  await boss.createQueue(queue)\n\n  const id = await boss.send(queue, { arg1: 'read me' })\n\n  console.log(`created job ${id} in queue ${queue}`)\n\n  await boss.work(queue, async ([ job ]) =\u003e {\n    console.log(`received job ${job.id} with data ${JSON.stringify(job.data)}`)\n  })\n}\n\nreadme()\n  .catch(err =\u003e {\n    console.log(err)\n    process.exit(1)\n  })\n```\n\npg-boss is a job queue built in Node.js on top of PostgreSQL in order to provide background processing and reliable asynchronous execution to Node.js applications.\n\npg-boss relies on Postgres's SKIP LOCKED, a feature built specifically for message queues to resolve record locking challenges inherent with relational databases. This provides exactly-once delivery and the safety of guaranteed atomic commits to asynchronous job processing.\n\nThis will likely cater the most to teams already familiar with the simplicity of relational database semantics and operations (SQL, querying, and backups). It will be especially useful to those already relying on PostgreSQL that want to limit how many systems are required to monitor and support in their architecture.\n\n\n## Summary \u003c!-- {docsify-ignore-all} --\u003e\n* Exactly-once job delivery\n* Create jobs within your existing database transaction\n* Backpressure-compatible polling workers\n* Cron scheduling\n* Queue storage policies to support a variety of rate limiting, debouncing, and concurrency use cases\n* Priority queues, dead letter queues, job deferral, automatic retries with exponential backoff\n* Pub/sub API for fan-out queue relationships\n* SQL support for non-Node.js runtimes for most operations\n* Serverless function compatible\n* Multi-master compatible (for example, in a Kubernetes ReplicaSet)\n\n## CLI\n\npg-boss includes a command-line interface for managing database migrations without writing code. This is useful for CI/CD pipelines, database setup scripts, or manual schema management.\n\n### Installation\n\nWhen installed globally, the CLI is available as `pg-boss`:\n\n```bash\nnpm install -g pg-boss\npg-boss --help\n```\n\nOr run directly with npx:\n\n```bash\nnpx pg-boss --help\n```\n\n### Commands\n\n| Command | Description |\n|---------|-------------|\n| `migrate` | Run pending migrations (creates schema if not exists) |\n| `create` | Create initial pg-boss schema |\n| `version` | Show current schema version |\n| `rollback` | Rollback the last migration |\n| `plans \u003csubcommand\u003e` | Output SQL without executing (subcommands: `create`, `migrate`, `rollback`) |\n\n### Connection Configuration\n\nThe CLI supports multiple ways to configure the database connection, in order of precedence:\n\n1. **Command-line arguments**\n   ```bash\n   pg-boss migrate --connection-string postgres://user:pass@host/database\n   # or individual options\n   pg-boss migrate --host localhost --port 5432 --database mydb --user postgres --password secret\n   ```\n\n2. **Environment variables**\n   ```bash\n   PGBOSS_DATABASE_URL=postgres://user:pass@host/database pg-boss migrate\n   # or individual variables\n   PGBOSS_HOST=localhost PGBOSS_PORT=5432 PGBOSS_DATABASE=mydb PGBOSS_USER=postgres PGBOSS_PASSWORD=secret pg-boss migrate\n   ```\n\n   This allows admin credentials for migrations to coexist with regular application database credentials (e.g., `DATABASE_URL` for the app, `PGBOSS_DATABASE_URL` for migrations).\n\n3. **Config file** (pgboss.json or .pgbossrc in current directory, or specify with `--config`)\n   ```bash\n   pg-boss migrate --config ./config/pgboss.json\n   ```\n\n   Config file format:\n   ```json\n   {\n     \"host\": \"localhost\",\n     \"port\": 5432,\n     \"database\": \"mydb\",\n     \"user\": \"postgres\",\n     \"password\": \"secret\",\n     \"schema\": \"pgboss\"\n   }\n   ```\n\n### Options\n\n| Option | Short | Description |\n|--------|-------|-------------|\n| `--connection-string` | `-c` | PostgreSQL connection string |\n| `--host` | | Database host |\n| `--port` | | Database port |\n| `--database` | `-d` | Database name |\n| `--user` | `-u` | Database user |\n| `--password` | `-p` | Database password |\n| `--schema` | `-s` | pg-boss schema name (default: pgboss) |\n| `--config` | | Path to config file |\n| `--dry-run` | | Show SQL without executing (for migrate, create, rollback) |\n\n### Examples\n\n```bash\n# Create schema in a new database\npg-boss create --connection-string postgres://localhost/myapp\n\n# Run migrations in CI/CD pipeline\nPGBOSS_DATABASE_URL=$PGBOSS_DATABASE_URL pg-boss migrate\n\n# Preview migration SQL before running\npg-boss migrate --connection-string postgres://localhost/myapp --dry-run\n\n# Check current schema version\npg-boss version -c postgres://localhost/myapp\n\n# Use a custom schema name\npg-boss migrate -c postgres://localhost/myapp --schema myapp_jobs\n\n# Output SQL for creating schema (useful for review or manual execution)\npg-boss plans create --schema myapp_jobs\n```\n\n## Dashboard\n\nA [web-based dashboard](https://www.npmjs.com/package/@pg-boss/dashboard) is available for monitoring and managing pg-boss job queues. It provides an overview of queue statistics, job browsing and filtering, job actions (create, cancel, retry, resume, delete), warning history, and multi-database support.\n\n```bash\nnpm i @pg-boss/dashboard\nDATABASE_URL=\"postgres://user:password@localhost:5432/mydb\" npx pg-boss-dashboard\n```\n\nSee the [dashboard documentation](https://github.com/timgit/pg-boss/blob/master/packages/dashboard/README.md) for full configuration and deployment options.\n\n## Requirements\n* Node 22.12 or higher for CommonJS's require(esm)\n* PostgreSQL 13 or higher\n\n## Documentation\n* [Docs](https://timgit.github.io/pg-boss/)\n\n## Contributing\nTo setup a development environment for this library:\n\n```bash\ngit clone https://github.com/timgit/pg-boss.git\nnpm install\n```\n\nTo run the test suite, linter and code coverage:\n```bash\nnpm run cover\n```\n\nThe test suite will try and create a new database named pgboss. The [config.json](https://github.com/timgit/pg-boss/blob/master/test/config.json) file has the default credentials to connect to postgres.\n\nThe [Docker Compose](https://github.com/timgit/pg-boss/blob/master/docker-compose.yaml) file can be used to start a local postgres instance for testing:\n\n```bash\ndocker compose up\n```\n","funding_links":["https://github.com/sponsors/timgit"],"categories":["JavaScript","Queuing","TypeScript","\u003ca name=\"TypeScript\"\u003e\u003c/a\u003eTypeScript","Work Queues"],"sub_categories":["Logical Replication"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimgit%2Fpg-boss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimgit%2Fpg-boss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimgit%2Fpg-boss/lists"}