{"id":22382369,"url":"https://github.com/jcoreio/wait-for-postgres","last_synced_at":"2025-03-26T19:40:40.910Z","repository":{"id":33660705,"uuid":"159604622","full_name":"jcoreio/wait-for-postgres","owner":"jcoreio","description":"Wait for a Postgres database to become available","archived":false,"fork":false,"pushed_at":"2023-01-04T21:52:00.000Z","size":2536,"stargazers_count":0,"open_issues_count":16,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-03T04:17:28.190Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jcoreio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-29T03:54:40.000Z","updated_at":"2021-11-07T16:35:16.000Z","dependencies_parsed_at":"2023-01-15T02:00:44.661Z","dependency_job_id":null,"html_url":"https://github.com/jcoreio/wait-for-postgres","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcoreio%2Fwait-for-postgres","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcoreio%2Fwait-for-postgres/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcoreio%2Fwait-for-postgres/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcoreio%2Fwait-for-postgres/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcoreio","download_url":"https://codeload.github.com/jcoreio/wait-for-postgres/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245726707,"owners_count":20662544,"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","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":[],"created_at":"2024-12-05T00:12:42.552Z","updated_at":"2025-03-26T19:40:40.887Z","avatar_url":"https://github.com/jcoreio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Wait For Postgres\n\nWait for a Postgres database to become available\n\n## Installation\n\n`npm install --save @jcoreio/wait-for-postgres`\n\nor\n\n`yarn add @jcoreio/wait-for-postgres`\n\n## Usage\n\nWait for Postgres to be ready, throwing an `Error` after a timeout:\n\n```ts\nimport { waitForPostgres } from '@jcoreio/wait-for-postgres'\n\n// returns when Postgres becomes available, or throws an Error if Postgres does not become available \n// before the timeout expires\nawait waitForPostgres({\n  host: 'localhost',\n  user: 'postgres',\n  password: 'password',\n  database: 'database',\n  timeout: 30 * 1000 // milliseconds\n})\n```\n\nCheck if Postgres is ready, returning `true` when ready or `false` if the timeout expires before the\ndatabase is ready:\n\n```ts\nimport { isPostgresReady } from '@jcoreio/wait-for-postgres'\n\n// returns true when Postgres becomes available, or returns false if Postgres does not become available \n// before the timeout expires\nconst isReady = await isPostgresReady({\n  host: 'localhost',\n  user: 'postgres',\n  password: 'password',\n  database: 'database',\n  timeout: 1000 // milliseconds\n})\n```\n\n## License\n\n[Apache-2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcoreio%2Fwait-for-postgres","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcoreio%2Fwait-for-postgres","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcoreio%2Fwait-for-postgres/lists"}