{"id":23789946,"url":"https://github.com/blackglory/extra-pool","last_synced_at":"2026-04-09T23:02:22.879Z","repository":{"id":49373419,"uuid":"517533365","full_name":"BlackGlory/extra-pool","owner":"BlackGlory","description":"🌲 A library that helps you create object/thread/connection pools","archived":false,"fork":false,"pushed_at":"2023-06-10T18:23:46.000Z","size":247,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-29T11:52:43.754Z","etag":null,"topics":["browser","library","nodejs","npm-package","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/extra-pool","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/BlackGlory.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"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}},"created_at":"2022-07-25T05:45:26.000Z","updated_at":"2022-11-24T16:51:46.000Z","dependencies_parsed_at":"2025-02-21T12:43:08.996Z","dependency_job_id":"530e9bdd-0522-48a3-9349-33191c69cb93","html_url":"https://github.com/BlackGlory/extra-pool","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/BlackGlory/extra-pool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackGlory%2Fextra-pool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackGlory%2Fextra-pool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackGlory%2Fextra-pool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackGlory%2Fextra-pool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlackGlory","download_url":"https://codeload.github.com/BlackGlory/extra-pool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackGlory%2Fextra-pool/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265571030,"owners_count":23790001,"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":["browser","library","nodejs","npm-package","typescript"],"created_at":"2025-01-01T17:17:46.105Z","updated_at":"2026-04-09T23:02:22.874Z","avatar_url":"https://github.com/BlackGlory.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# extra-pool\nA library that helps you create object/thread/connection pools.\n\n## Install\n```sh\nnpm install --save extra-pool\n# or\nyarn add extra-pool\n```\n\n## Usage\n```ts\nimport { Pool } from 'extra-pool'\n\nconst dbConnectionPool = new Pool({\n  create: () =\u003e Database.connect(/* ... */)\n, destroy: connection =\u003e conneciton.close()\n, minInstances: 1\n, maxInstances: 8\n, idleTimeout: 1000 * 60\n})\n\nconst rows = await dbConnectionPool.use(connection =\u003e connection.query(/* ... */))\n\nawait dbConnectionPool.destroy()\n```\n\n## API\n### Pool\n```ts\ninterface IPoolOptions\u003cT\u003e {\n  create: () =\u003e Awaitable\u003cT\u003e\n  destroy?: (instance: T) =\u003e Awaitable\u003cvoid\u003e\n  maxInstances?: number\n  minInstances?: number = 0\n  idleTimeout?: number = 0\n  concurrencyPerInstance? = 1\n}\n\nclass Pool\u003cT\u003e {\n  readonly capacity: number\n  readonly size: number\n\n  constructor(options: IPoolOptions\u003cT\u003e)\n\n  prewarm(targetInstances: number): Promise\u003cvoid\u003e\n\n  use\u003cU\u003e(fn: (instance: T) =\u003e Awaitable\u003cU\u003e): Promise\u003cU\u003e\n\n  destroy(): Promise\u003cvoid\u003e\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackglory%2Fextra-pool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblackglory%2Fextra-pool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackglory%2Fextra-pool/lists"}