{"id":17402913,"url":"https://github.com/thlorenz/awaitable-pool","last_synced_at":"2025-10-25T06:42:07.243Z","repository":{"id":65995311,"uuid":"255715324","full_name":"thlorenz/awaitable-pool","owner":"thlorenz","description":"Object pool with an async checkout function.","archived":false,"fork":false,"pushed_at":"2020-04-15T16:51:37.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-04T20:43:39.427Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thlorenz.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},"funding":{"github":"thlorenz","patreon":"thlorenz","custom":["paypal.me/thlorenz"]}},"created_at":"2020-04-14T20:13:25.000Z","updated_at":"2020-04-15T16:51:35.000Z","dependencies_parsed_at":"2023-03-10T23:27:34.313Z","dependency_job_id":null,"html_url":"https://github.com/thlorenz/awaitable-pool","commit_stats":{"total_commits":7,"total_committers":2,"mean_commits":3.5,"dds":0.1428571428571429,"last_synced_commit":"0e74c3ad0c3384f469544a5be1bc2cd92e04f029"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thlorenz%2Fawaitable-pool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thlorenz%2Fawaitable-pool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thlorenz%2Fawaitable-pool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thlorenz%2Fawaitable-pool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thlorenz","download_url":"https://codeload.github.com/thlorenz/awaitable-pool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246237436,"owners_count":20745348,"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-10-16T18:37:50.162Z","updated_at":"2025-10-25T06:42:02.192Z","avatar_url":"https://github.com/thlorenz.png","language":"TypeScript","readme":"# awaitable-pool [![](https://github.com/thlorenz/awaitable-pool/workflows/Node%20CI/badge.svg?branch=master)](https://github.com/thlorenz/awaitable-pool/actions)\n\nObject pool with an async checkout function.\n\n## Example\n\n```js\nconst { AwaitablePool } = require('awaitable-pool')\n\nlet count = 0\nconst poolSize = 2\nconst createObject = () =\u003e ({\n  id: (++count).toString(),\n})\n\nconst pool = new AwaitablePool(createObject, poolSize)\n\n;(async () =\u003e {\n  const item1 = await pool.checkout()\n  console.log('checked out %s', item1.id)\n  const item2 = await pool.checkout()\n  console.log('checked out %s', item2.id)\n\n  console.log('checking out another item')\n  pool.checkout().then((item) =\u003e console.log('checked out %s', item.id))\n\n  console.log('checking in 1')\n  pool.checkin(item1)\n})()\n```\n\n```\nchecked out 1\nchecked out 2\nchecking out another item\nchecking in 1\nchecked out 1\n```\n\n## Installation\n\n    npm install awaitable-pool\n\n## Alternatives\n\nThis library is small and thus also only serves a small spectrum of use cases.\nIf you want a more complete implementation have a look at either of the following.\n\n- [tarn](https://github.com/Vincit/tarn.js)\n\n## LICENSE\n\nMIT\n","funding_links":["https://github.com/sponsors/thlorenz","https://patreon.com/thlorenz","paypal.me/thlorenz"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthlorenz%2Fawaitable-pool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthlorenz%2Fawaitable-pool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthlorenz%2Fawaitable-pool/lists"}