{"_id":"promise-coalesce","_rev":"3688943-6517c4ec29e6041681d0f1a2","dist-tags":{"latest":"1.5.0"},"name":"promise-coalesce","time":{"created":"2023-09-30T06:49:16.330Z","modified":"2025-11-08T05:12:20.387Z","1.0.0":"2023-09-30T06:31:59.792Z","1.1.0":"2023-10-01T02:50:17.887Z","1.1.1":"2023-10-25T01:49:17.604Z","1.1.2":"2023-12-19T03:04:02.821Z","1.3.0":"2025-11-08T05:04:30.689Z","1.5.0":"2025-11-08T05:12:07.965Z"},"versions":{"1.0.0":{"name":"promise-coalesce","version":"1.0.0","description":"Coalesces multiple promises for the same identifier into a single request.","keywords":["promise","coalesce","async"],"author":{"name":"Doug Ayers","url":"https://github.com/douglascayers"},"repository":{"url":"git+https://github.com/douglascayers/promise-coalesce.git"},"bugs":{"url":"https://github.com/douglascayers/promise-coalesce/issues"},"homepage":"https://github.com/douglascayers/promise-coalesce#readme","license":"BSD-3-Clause","scripts":{"clean":"rm -rf dist && rm -rf coverage","prettier":"prettier --check --ignore-unknown --no-error-on-unmatched-pattern .","prettier:fix":"yarn prettier --write","lint":"eslint --ext .ts,.tsx,.js,.json .","lint:fix":"yarn lint --fix","lint:staged":"lint-staged --concurrent 1","format":"yarn prettier:fix && yarn lint:fix","build":"yarn clean && tsc","prepare":"yarn build","test":"jest","postinstall":"husky install","semantic-release":"semantic-release"},"release":{"branches":["main"],"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator","@semantic-release/changelog","@semantic-release/npm","@semantic-release/git","@semantic-release/github"]},"exports":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=16"},"dependencies":{},"devDependencies":{"@commitlint/cli":"^17.7.2","@commitlint/config-conventional":"^17.7.0","@semantic-release/changelog":"^6.0.3","@semantic-release/git":"^10.0.1","@types/jest":"^29.5.5","@types/node":"^18.17.19","@typescript-eslint/eslint-plugin":"^6.7.3","@typescript-eslint/parser":"^6.7.3","eslint":"^8.50.0","eslint-config-prettier":"^9.0.0","eslint-plugin-import":"^2.28.1","eslint-plugin-prettier":"^5.0.0","eslint-plugin-unused-imports":"^3.0.0","husky":"^8.0.3","jest":"^29.7.0","lint-staged":"^14.0.1","prettier":"^3.0.3","semantic-release":"^22.0.5","ts-jest":"^29.1.1","ts-node":"^10.9.1","typescript":"^5.2.2"},"commitlint":{"extends":["@commitlint/config-conventional"]},"lint-staged":{"*.{ts,tsx,js,json}":"yarn lint:fix","*":"yarn prettier:fix"},"_id":"promise-coalesce@1.0.0","gitHead":"59dce01023267181aa5d284e3cc4b85c18403abd","_nodeVersion":"18.18.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-76gYrTHcnDNI0b8KDIVXhiCKrDDWHjhnjUgl+nhXQEF/Htp9MspV32H1iryXAjR4tiZ753t1EHOaFeDHjlOjXA==","shasum":"cb2fe2308ed2ed760afb5161a9e2bed429cff193","tarball":"https://registry.npmmirror.com/promise-coalesce/-/promise-coalesce-1.0.0.tgz","fileCount":12,"unpackedSize":11814,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGbugg9BZQD8pPUobup0/U+uAB+Agau7aLNPPEO3TSStAiBfCkJW69B93hHZ5qITPyLcspewQZxTdSdcjWVBxqcPpg=="}],"size":4652},"_npmUser":{"name":"douglascayers","email":"douglascayers@gmail.com"},"directories":{},"maintainers":[{"name":"douglascayers","email":"douglascayers@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/promise-coalesce_1.0.0_1696055519619_0.06559842318553333"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-09-30T06:31:59.792Z","publish_time":1696055519792,"_source_registry_name":"default","hasInstallScript":true},"1.1.0":{"name":"promise-coalesce","version":"1.1.0","description":"Coalesces multiple promises for the same identifier into a single request.","keywords":["promise","coalesce","async"],"author":{"name":"Doug Ayers","url":"https://github.com/douglascayers"},"repository":{"url":"git+https://github.com/douglascayers/promise-coalesce.git"},"bugs":{"url":"https://github.com/douglascayers/promise-coalesce/issues"},"homepage":"https://github.com/douglascayers/promise-coalesce#readme","license":"BSD-3-Clause","scripts":{"clean":"rm -rf dist && rm -rf coverage","prettier":"prettier --check --ignore-unknown --no-error-on-unmatched-pattern .","prettier:fix":"yarn prettier --write","lint":"eslint --ext .ts,.tsx,.js,.json .","lint:fix":"yarn lint --fix","lint:staged":"lint-staged --concurrent 1","format":"yarn prettier:fix && yarn lint:fix","build":"yarn clean && tsc","prepare":"yarn build && npx husky install","test":"jest","semantic-release":"semantic-release"},"release":{"branches":["main"],"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator","@semantic-release/changelog","@semantic-release/npm","@semantic-release/git","@semantic-release/github"]},"exports":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=16"},"dependencies":{},"devDependencies":{"@commitlint/cli":"^17.7.2","@commitlint/config-conventional":"^17.7.0","@semantic-release/changelog":"^6.0.3","@semantic-release/git":"^10.0.1","@types/jest":"^29.5.5","@types/node":"^18.17.19","@typescript-eslint/eslint-plugin":"^6.7.3","@typescript-eslint/parser":"^6.7.3","eslint":"^8.50.0","eslint-config-prettier":"^9.0.0","eslint-plugin-import":"^2.28.1","eslint-plugin-prettier":"^5.0.0","eslint-plugin-unused-imports":"^3.0.0","husky":"^8.0.3","jest":"^29.7.0","lint-staged":"^14.0.1","prettier":"^3.0.3","semantic-release":"^22.0.5","ts-jest":"^29.1.1","ts-node":"^10.9.1","typescript":"^5.2.2"},"commitlint":{"extends":["@commitlint/config-conventional"]},"lint-staged":{"*.{ts,tsx,js,json}":"yarn lint:fix","*":"yarn prettier:fix"},"_id":"promise-coalesce@1.1.0","gitHead":"5ff083288f2863eb1abb9f9d67b51f9a79b61641","_nodeVersion":"18.18.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-KhoxPu2XffFNuJlM0G7TlIlDEQAEFd7G/IJhWDT6ISo3IAqFI4DAlMgzkQatzCXV0PmI3q2ENZm1GCTUwRJ9fQ==","shasum":"c7fcdaaa44044eb44c0982f7b2971cfa41299cba","tarball":"https://registry.npmmirror.com/promise-coalesce/-/promise-coalesce-1.1.0.tgz","fileCount":12,"unpackedSize":11799,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFULbC5wOGErUIffzrnCsXwdr1C9cDJTPjAlc95H+oC0AiEA1vmGZiOg4/4qukq5K0r1NLJ0tKK608D0oXwSsRDxjvM="}],"size":4651},"_npmUser":{"name":"douglascayers","email":"douglascayers@gmail.com"},"directories":{},"maintainers":[{"name":"douglascayers","email":"douglascayers@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/promise-coalesce_1.1.0_1696128617638_0.2587908979990887"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-10-01T02:50:17.887Z","publish_time":1696128617887,"_source_registry_name":"default"},"1.1.1":{"name":"promise-coalesce","version":"1.1.1","description":"Coalesces multiple promises for the same identifier into a single request","keywords":["promise","coalesce","async"],"author":{"name":"Doug Ayers","url":"https://github.com/douglascayers"},"repository":{"url":"git+https://github.com/douglascayers/promise-coalesce.git"},"bugs":{"url":"https://github.com/douglascayers/promise-coalesce/issues"},"homepage":"https://github.com/douglascayers/promise-coalesce#readme","license":"BSD-3-Clause","scripts":{"clean":"rm -rf dist && rm -rf coverage","prettier":"prettier --check --ignore-unknown --no-error-on-unmatched-pattern .","prettier:fix":"yarn prettier --write","lint":"eslint --ext .ts,.tsx,.js,.json .","lint:fix":"yarn lint --fix","lint:staged":"lint-staged --concurrent 1","format":"yarn prettier:fix && yarn lint:fix","build":"yarn clean && tsc","prepare":"yarn build && npx husky install","test":"jest","semantic-release":"semantic-release"},"release":{"branches":["main"],"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator","@semantic-release/changelog","@semantic-release/npm","@semantic-release/git","@semantic-release/github"]},"exports":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=18"},"dependencies":{},"devDependencies":{"@commitlint/cli":"^18.0.0","@commitlint/config-conventional":"^18.0.0","@semantic-release/changelog":"^6.0.3","@semantic-release/git":"^10.0.1","@types/jest":"^29.5.6","@types/node":"^18.17.19","@typescript-eslint/eslint-plugin":"^6.9.0","@typescript-eslint/parser":"^6.9.0","eslint":"^8.52.0","eslint-config-prettier":"^9.0.0","eslint-plugin-import":"^2.29.0","eslint-plugin-prettier":"^5.0.1","eslint-plugin-unused-imports":"^3.0.0","husky":"^8.0.3","jest":"^29.7.0","lint-staged":"^15.0.2","prettier":"^3.0.3","semantic-release":"^22.0.5","ts-jest":"^29.1.1","ts-node":"^10.9.1","typescript":"^5.2.2"},"commitlint":{"extends":["@commitlint/config-conventional"]},"lint-staged":{"*.{ts,tsx,js,json}":"yarn lint:fix","*":"yarn prettier:fix"},"_id":"promise-coalesce@1.1.1","gitHead":"97494d1e31372dfb3445105afcb808b030f38297","_nodeVersion":"18.18.2","_npmVersion":"10.1.0","dist":{"integrity":"sha512-k7+VaIwZc5dRfSF6RELqRY1+LCmcCkrnuNV9HzIpA6iwRHKke+j9yb0LBTTHQ2RRgf6AlMl9TntuTzcgV/BZwg==","shasum":"01f0d4c06060507fb0ca1f1cca8fa90ada1e22ba","tarball":"https://registry.npmmirror.com/promise-coalesce/-/promise-coalesce-1.1.1.tgz","fileCount":12,"unpackedSize":12420,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRPvaA2M/qPVTAYc1yboDlLolVU4JL3aKc9TgUEmVoTQIhAPMXCeqZ7yUC1TmcArda0IFXiKH7WaeSRdakKs2kWv8s"}],"size":4833},"_npmUser":{"name":"douglascayers","email":"douglascayers@gmail.com"},"directories":{},"maintainers":[{"name":"douglascayers","email":"douglascayers@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/promise-coalesce_1.1.1_1698198557386_0.5804762792797205"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-10-25T01:49:17.604Z","publish_time":1698198557604,"_source_registry_name":"default"},"1.1.2":{"name":"promise-coalesce","version":"1.1.2","description":"Coalesces multiple promises for the same identifier into a single request","keywords":["promise","coalesce","async"],"author":{"name":"Doug Ayers","url":"https://github.com/douglascayers"},"repository":{"url":"git+https://github.com/douglascayers/promise-coalesce.git"},"bugs":{"url":"https://github.com/douglascayers/promise-coalesce/issues"},"homepage":"https://github.com/douglascayers/promise-coalesce#readme","license":"BSD-3-Clause","scripts":{"clean":"rm -rf dist && rm -rf coverage","prettier":"prettier --check --ignore-unknown --no-error-on-unmatched-pattern .","prettier:fix":"yarn prettier --write","lint":"eslint --ext .ts,.tsx,.js,.json .","lint:fix":"yarn lint --fix","lint:staged":"lint-staged --concurrent 1","format":"yarn prettier:fix && yarn lint:fix","build":"yarn clean && tsc","prepare":"yarn build && npx husky install","test":"jest","semantic-release":"semantic-release"},"release":{"branches":["main"],"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator","@semantic-release/changelog","@semantic-release/npm","@semantic-release/git","@semantic-release/github"]},"exports":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=16"},"dependencies":{},"devDependencies":{"@commitlint/cli":"^18.0.0","@commitlint/config-conventional":"^18.0.0","@semantic-release/changelog":"^6.0.3","@semantic-release/git":"^10.0.1","@types/jest":"^29.5.6","@types/node":"^18.17.19","@typescript-eslint/eslint-plugin":"^6.9.0","@typescript-eslint/parser":"^6.9.0","eslint":"^8.52.0","eslint-config-prettier":"^9.0.0","eslint-plugin-import":"^2.29.0","eslint-plugin-prettier":"^5.0.1","eslint-plugin-unused-imports":"^3.0.0","husky":"^8.0.3","jest":"^29.7.0","lint-staged":"^15.0.2","prettier":"^3.0.3","semantic-release":"^22.0.5","ts-jest":"^29.1.1","ts-node":"^10.9.1","typescript":"^5.2.2"},"commitlint":{"extends":["@commitlint/config-conventional"]},"lint-staged":{"*.{ts,tsx,js,json}":"yarn lint:fix","*":"yarn prettier:fix"},"_id":"promise-coalesce@1.1.2","gitHead":"f9d29734628ba5a2e61453d2df5246485d792dce","_nodeVersion":"18.19.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-zLaJ9b8hnC564fnJH6NFSOGZYYdzrAJn2JUUIwzoQb32fG2QAakpDNM+CZo1km6keXkRXRM+hml1BFAPVnPkxg==","shasum":"5d3bc4d0b2cf2e41e9df7cbeb6519b2a09459e3d","tarball":"https://registry.npmmirror.com/promise-coalesce/-/promise-coalesce-1.1.2.tgz","fileCount":12,"unpackedSize":12420,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDk0HVQyfrXwaCXmao9PEZy+SQdAFmk5KABkNsw1kSmGwIgbJ4OvOUlgVatLDYhHv4bpyDIgPve54atIruPvtIrjmM="}],"size":4901},"_npmUser":{"name":"douglascayers","email":"douglascayers@gmail.com"},"directories":{},"maintainers":[{"name":"douglascayers","email":"douglascayers@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/promise-coalesce_1.1.2_1702955042599_0.16369499879146088"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-12-19T03:04:02.821Z","publish_time":1702955042821,"_source_registry_name":"default"},"1.3.0":{"name":"promise-coalesce","version":"1.3.0","description":"Coalesces multiple promises for the same identifier into a single request","keywords":["promise","coalesce","async"],"author":{"name":"Doug Ayers","url":"https://github.com/douglascayers"},"repository":{"url":"git+https://github.com/douglascayers/promise-coalesce.git"},"bugs":{"url":"https://github.com/douglascayers/promise-coalesce/issues"},"homepage":"https://github.com/douglascayers/promise-coalesce#readme","license":"BSD-3-Clause","scripts":{"clean":"rm -rf dist && rm -rf coverage","prettier":"prettier --check --ignore-unknown --no-error-on-unmatched-pattern .","prettier:fix":"yarn prettier --write","lint":"eslint --ext .ts,.tsx,.js,.json .","lint:fix":"yarn lint --fix","lint:staged":"lint-staged --concurrent 1","format":"yarn prettier:fix && yarn lint:fix","build":"yarn clean && tsc","prepare":"yarn build && npx husky install","test":"jest","semantic-release":"semantic-release"},"release":{"branches":["main"],"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator","@semantic-release/changelog","@semantic-release/npm","@semantic-release/git","@semantic-release/github"]},"exports":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=16"},"dependencies":{},"devDependencies":{"@commitlint/cli":"^18.0.0","@commitlint/config-conventional":"^18.0.0","@semantic-release/changelog":"^6.0.3","@semantic-release/git":"^10.0.1","@types/jest":"^29.5.6","@types/node":"^18.17.19","@typescript-eslint/eslint-plugin":"^6.9.0","@typescript-eslint/parser":"^6.9.0","eslint":"^8.52.0","eslint-config-prettier":"^9.0.0","eslint-plugin-import":"^2.29.0","eslint-plugin-prettier":"^5.0.1","eslint-plugin-unused-imports":"^3.0.0","husky":"^8.0.3","jest":"^29.7.0","lint-staged":"^15.0.2","prettier":"^3.0.3","semantic-release":"^22.0.5","ts-jest":"^29.1.1","ts-node":"^10.9.1","typescript":"^5.2.2"},"commitlint":{"extends":["@commitlint/config-conventional"]},"lint-staged":{"*.{ts,tsx,js,json}":"yarn lint:fix","*":"yarn prettier:fix"},"gitHead":"07f6903f95035b364b8081c6a95b107d62b1875a","_id":"promise-coalesce@1.3.0","_nodeVersion":"20.19.2","_npmVersion":"11.6.2","dist":{"integrity":"sha512-2zaNnXKuGsUkkwC9S+3RHDgeHkvkaUVLPMJb9k9+Fg/wC14RwnMgm1HCZ1hU4EByv3Z8t8E58IVZFJHdNQYKhw==","shasum":"1a5f3b966b29c976ff2d49f71d913ec56e05ca4b","tarball":"https://registry.npmmirror.com/promise-coalesce/-/promise-coalesce-1.3.0.tgz","fileCount":9,"unpackedSize":10093,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC8C8R7fCf6NvJwPfffYkfG8fIeauNM5Y5qGo6sEAjfrgIhANMBZTQc3qmnt9nVuyj7+HU63Q/Jf+hKrKlsShvL9wFN"}],"size":4282},"_npmUser":{"name":"douglascayers","email":"douglascayers@gmail.com"},"directories":{},"maintainers":[{"name":"douglascayers","email":"douglascayers@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/promise-coalesce_1.3.0_1762578270444_0.7268198478609622"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-11-08T05:04:30.689Z","publish_time":1762578270689,"_source_registry_name":"default"},"1.5.0":{"name":"promise-coalesce","version":"1.5.0","description":"Coalesces multiple promises for the same identifier into a single request","keywords":["promise","coalesce","async"],"author":{"name":"Doug Ayers","url":"https://github.com/douglascayers"},"repository":{"url":"git+https://github.com/douglascayers/promise-coalesce.git"},"bugs":{"url":"https://github.com/douglascayers/promise-coalesce/issues"},"homepage":"https://github.com/douglascayers/promise-coalesce#readme","license":"BSD-3-Clause","scripts":{"clean":"rm -rf dist && rm -rf coverage","prettier":"prettier --check --ignore-unknown --no-error-on-unmatched-pattern .","prettier:fix":"yarn prettier --write","lint":"eslint --ext .ts,.tsx,.js,.json .","lint:fix":"yarn lint --fix","lint:staged":"lint-staged --concurrent 1","format":"yarn prettier:fix && yarn lint:fix","build":"yarn clean && tsc","prepare":"yarn build && npx husky install","test":"jest","semantic-release":"semantic-release"},"release":{"branches":["main"],"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator","@semantic-release/changelog","@semantic-release/npm","@semantic-release/git","@semantic-release/github"]},"exports":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=16"},"dependencies":{},"devDependencies":{"@commitlint/cli":"^18.0.0","@commitlint/config-conventional":"^18.0.0","@semantic-release/changelog":"^6.0.3","@semantic-release/git":"^10.0.1","@types/jest":"^29.5.6","@types/node":"^18.17.19","@typescript-eslint/eslint-plugin":"^6.9.0","@typescript-eslint/parser":"^6.9.0","eslint":"^8.52.0","eslint-config-prettier":"^9.0.0","eslint-plugin-import":"^2.29.0","eslint-plugin-prettier":"^5.0.1","eslint-plugin-unused-imports":"^3.0.0","husky":"^8.0.3","jest":"^29.7.0","lint-staged":"^15.0.2","prettier":"^3.0.3","semantic-release":"^22.0.5","ts-jest":"^29.1.1","ts-node":"^10.9.1","typescript":"^5.2.2"},"commitlint":{"extends":["@commitlint/config-conventional"]},"lint-staged":{"*.{ts,tsx,js,json}":"yarn lint:fix","*":"yarn prettier:fix"},"_id":"promise-coalesce@1.5.0","gitHead":"2626e1df9084db32748e530ec1eca65f78e198ee","_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-cTJ30U+ur1LD7pMPyQxiKIwxjtAjLsyU7ivRhVWZrX9BNIXtf78pc37vSMc8Vikx7DVzEKNk2SEJ5KWUpSG2ig==","shasum":"f840f2f5bec61468e659a9b7c269e173a663c4a1","tarball":"https://registry.npmmirror.com/promise-coalesce/-/promise-coalesce-1.5.0.tgz","fileCount":9,"unpackedSize":10093,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFAeGca8KQhVjkWMkRSgZ+8zaYU26ORbdJqH5wk1PV6iAiEAyJNgst2+8vTrACVmOXP0GJbfgtXrgoF05Efv7xDqISI="}],"size":4282},"_npmUser":{"name":"douglascayers","email":"douglascayers@gmail.com"},"directories":{},"maintainers":[{"name":"douglascayers","email":"douglascayers@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/promise-coalesce_1.5.0_1762578727779_0.6876571936898153"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-11-08T05:12:07.965Z","publish_time":1762578727965,"_source_registry_name":"default"}},"author":{"name":"Doug Ayers","url":"https://github.com/douglascayers"},"bugs":{"url":"https://github.com/douglascayers/promise-coalesce/issues"},"description":"Coalesces multiple promises for the same identifier into a single request","homepage":"https://github.com/douglascayers/promise-coalesce#readme","keywords":["promise","coalesce","async"],"license":"BSD-3-Clause","maintainers":[{"name":"douglascayers","email":"douglascayers@gmail.com"}],"readme":"## promise-coalesce\n\nCoalesces multiple promises for the same identifier into a single request.\n\nReduces load on downstream systems when requests occur at the same time,\nwithout dropping requests or needing exclusion locks or wait-and-retry attempts.\n\n## Install\n\nWith npm:\n\n```sh\nnpm install promise-coalesce\n```\n\nWith yarn:\n\n```sh\nyarn add promise-coalesce\n```\n\n## Usage\n\n```ts\nimport { coalesceAsync } from 'promise-coalesce';\n\nawait coalesceAsync('some-group-key', async () => {\n  /* your logic */\n});\n```\n\n## Example\n\n**Cache Miss Relief Buffer**\n\n```ts\nimport { coalesceAsync } from 'promise-coalesce';\n\n// Imagine you want to retrieve a value, and you have a cache to speed things up.\n// If the value isn't in the cache, you'll need to get it from the source system,\n// which can be a time-consuming process like a database query or an API request.\nasync function getValue(cacheKey: string): Promise<YourData> {\n  // When multiple requests try to fetch the same value from the cache at the same time,\n  // because of the way async operations work, yielding the event loop at each `await`,\n  // then they will all try to get it from the cache.\n  let cachedValue = await cache.get(cacheKey);\n  // They will take turns checking the condition and all see that the value is missing.\n  if (!cachedValue) {\n    // Here's where `coalesceAsync` comes to the rescue!\n    // Instead of making multiple expensive calls to the source system,\n    // we use `coalesceAsync`` to ensure it's called only once, and other requests\n    // wanting the same cache key wait for the result.\n    cachedValue = await coalesceAsync<YourData>(cacheKey, async () => {\n      // Now, we fetch the value from the source system.\n      const sourceValue = await getSourceValue();\n      // We also cache it for future use.\n      await cache.set(cacheKey, sourceValue, ttl);\n      // Now, the value is in the cache, and future requests will avoid calling the source system\n      // until the cached data expires (based on TTL).\n      return sourceValue;\n    });\n  }\n  return cachedValue;\n}\n```\n\n## Credits\n\nThis solution is inspired by [node-cache-manager](https://github.com/node-cache-manager/node-cache-manager)'s\n[CallbackFiller](https://github.com/node-cache-manager/node-cache-manager/blob/4.1.0/lib/callback_filler.js) from the `v4.x` line.\n\nIt was [removed](https://github.com/node-cache-manager/node-cache-manager/issues/417)\nin the `v5.x` line, and `promise-coalesce` is an attempt to recover that feature\nwhile also being generic enough for other applications.\n","repository":{"url":"git+https://github.com/douglascayers/promise-coalesce.git"},"_source_registry_name":"default"}