{"_id":"jitterbug","_rev":"32-b06c9edbcebeb5c11f02fa9af571332b","name":"jitterbug","dist-tags":{"latest":"1.0.6"},"versions":{"1.0.0-alpha.2":{"name":"jitterbug","version":"1.0.0-alpha.2","keywords":["retry","retry-logic","api-client","distributed-systems"],"author":{"name":"Cory Lewis"},"license":"MIT","_id":"jitterbug@1.0.0-alpha.2","maintainers":[{"name":"clewis8675309","email":"cory.lewis1997@gmail.com"}],"homepage":"https://github.com/mecharmor/jitterbug#readme","bugs":{"url":"https://github.com/mecharmor/jitterbug/issues"},"dist":{"shasum":"e4db03442f9908847026baf880e600e9c357ab9b","tarball":"https://registry.npmjs.org/jitterbug/-/jitterbug-1.0.0-alpha.2.tgz","fileCount":9,"integrity":"sha512-hzhKuVZixXPUsXyG0PPsxlfDFHkiYL7hLmLpeFb42y7J6suvYwNR+x2TEYDQ3x1v7aEmw8jhhSEK3+cPxVCkVw==","signatures":[{"sig":"MEQCIBjZ1DYeJ60QBHOOm8EAcDhZN4CXbuTPq33CHO/lDY51AiAVYEMnvzonaI2rABhT+BJB4Uwr3lxc/zUrHQc7yaDjWg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18968},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"f96df27bd5c9e2170aa5127ddba9d030bad585c2","scripts":{"dev":"tsup --watch","test":"vitest","build":"tsup","version":"npm run build","test:run":"vitest run","typecheck":"tsc --noEmit","test:watch":"vitest --watch","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build && npm run test:run"},"_npmUser":{"name":"clewis8675309","email":"cory.lewis1997@gmail.com"},"repository":{"url":"git+https://github.com/mecharmor/jitterbug.git","type":"git"},"_npmVersion":"10.8.2","description":"A lightweight library for building reliable retry behavior in distributed systems and API clients","directories":{},"_nodeVersion":"20.20.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","vitest":"^1.2.0","typescript":"^5.9.3","@types/node":"^25.2.0","@vitest/coverage-v8":"^1.2.0"},"_npmOperationalInternal":{"tmp":"tmp/jitterbug_1.0.0-alpha.2_1769973347378_0.3490932671429854","host":"s3://npm-registry-packages-npm-production"}},"1.0.0-alpha.4":{"name":"jitterbug","version":"1.0.0-alpha.4","keywords":["retry","retry-logic","api-client","distributed-systems"],"author":{"name":"Cory Lewis"},"license":"MIT","_id":"jitterbug@1.0.0-alpha.4","maintainers":[{"name":"clewis8675309","email":"cory.lewis1997@gmail.com"}],"homepage":"https://github.com/mecharmor/jitterbug#readme","bugs":{"url":"https://github.com/mecharmor/jitterbug/issues"},"dist":{"shasum":"71731bc169ea448595e5bc9308a5527f3f612c35","tarball":"https://registry.npmjs.org/jitterbug/-/jitterbug-1.0.0-alpha.4.tgz","fileCount":9,"integrity":"sha512-vASZOl9bUzZBKqiAwBUUnULs1VSrsuY4+iUeCm+kz4RF4WyAexmBLcDjvjD/wzdm32al9Az/FSEBeY2QJKFEAw==","signatures":[{"sig":"MEQCIHCNt++juqpj5pIsW2S/TEX319zJAa89ap7JuZ4BF66hAiAz9EX/04jBvF7Gw7H0iu6sl5IiArOZ1h1kIkmQksWngQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35635},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"0cb961f3a514148787cb165f097d45fff91775e1","scripts":{"dev":"tsup --watch","lint":"eslint . --ext .ts,.js","test":"vitest","build":"tsup","version":"npm run build","lint:fix":"eslint . --ext .ts,.js --fix","test:run":"vitest run","typecheck":"tsc --noEmit","test:watch":"vitest --watch","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build && npm run test:run"},"_npmUser":{"name":"clewis8675309","email":"cory.lewis1997@gmail.com"},"repository":{"url":"git+https://github.com/mecharmor/jitterbug.git","type":"git"},"_npmVersion":"10.8.2","description":"A lightweight library for building reliable retry behavior in distributed systems and API clients","directories":{},"_nodeVersion":"20.20.0","_hasShrinkwrap":false,"devDependencies":{"jiti":"^2.6.1","tsup":"^8.5.1","eslint":"^9.39.2","vitest":"^1.2.0","globals":"^17.3.0","typescript":"^5.9.3","@types/node":"^25.2.0","typescript-eslint":"^8.54.0","@vitest/coverage-v8":"^1.2.0"},"_npmOperationalInternal":{"tmp":"tmp/jitterbug_1.0.0-alpha.4_1769978498895_0.9977992193645047","host":"s3://npm-registry-packages-npm-production"}},"1.0.0-alpha.3":{"name":"jitterbug","version":"1.0.0-alpha.3","keywords":["retry","retry-logic","api-client","distributed-systems"],"author":{"name":"Cory Lewis"},"license":"MIT","_id":"jitterbug@1.0.0-alpha.3","maintainers":[{"name":"clewis8675309","email":"cory.lewis1997@gmail.com"}],"homepage":"https://github.com/mecharmor/jitterbug#readme","bugs":{"url":"https://github.com/mecharmor/jitterbug/issues"},"dist":{"shasum":"9be1b4c6e67bb905f31010e7af5293926f51e2d2","tarball":"https://registry.npmjs.org/jitterbug/-/jitterbug-1.0.0-alpha.3.tgz","fileCount":9,"integrity":"sha512-8zd2joRqrqvob7+7wq9vGxuicz00yKc3LvOfZjbpNgY/j8ma+hYH2LSYAcOcIoWSYDTJv+4GbHpUuhRQYRrD1Q==","signatures":[{"sig":"MEUCIQCnMwKKbylfPv615s2y9AtNYLw3RhJPHYdANPxvgXv+4AIgGMYCoFPdaN5XFLwHvHs39M276FQ2UJxilRWhWxwuGpA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35623},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"f235a109e71ec1cd88eb1cf308b08afcd92bbbdd","scripts":{"dev":"tsup --watch","lint":"eslint . --ext .ts,.js","test":"vitest","build":"tsup","version":"npm run build","lint:fix":"eslint . --ext .ts,.js --fix","test:run":"vitest run","typecheck":"tsc --noEmit","test:watch":"vitest --watch","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build && npm run test:run"},"_npmUser":{"name":"clewis8675309","email":"cory.lewis1997@gmail.com"},"repository":{"url":"git+https://github.com/mecharmor/jitterbug.git","type":"git"},"_npmVersion":"10.8.2","description":"A lightweight library for building reliable retry behavior in distributed systems and API clients","directories":{},"_nodeVersion":"20.20.0","_hasShrinkwrap":false,"devDependencies":{"jiti":"^2.6.1","tsup":"^8.5.1","eslint":"^9.39.2","vitest":"^1.2.0","globals":"^17.3.0","typescript":"^5.9.3","@types/node":"^25.2.0","typescript-eslint":"^8.54.0","@vitest/coverage-v8":"^1.2.0"},"_npmOperationalInternal":{"tmp":"tmp/jitterbug_1.0.0-alpha.3_1769978508697_0.5909416267581955","host":"s3://npm-registry-packages-npm-production"}},"1.0.0-alpha.5":{"name":"jitterbug","version":"1.0.0-alpha.5","keywords":["retry","retry-logic","api-client","distributed-systems"],"author":{"name":"Cory Lewis"},"license":"MIT","_id":"jitterbug@1.0.0-alpha.5","maintainers":[{"name":"clewis8675309","email":"cory.lewis1997@gmail.com"}],"homepage":"https://github.com/mecharmor/jitterbug#readme","bugs":{"url":"https://github.com/mecharmor/jitterbug/issues"},"dist":{"shasum":"7602d053cbf9b3e23ef980051991bf6398ddf8c7","tarball":"https://registry.npmjs.org/jitterbug/-/jitterbug-1.0.0-alpha.5.tgz","fileCount":9,"integrity":"sha512-qeYXMTnwzUAv1ipirJJQ0fSiqh2BGhbJAy2NzuExjWSVlK5W2PTDlkSDYg0w0qCUp8NBAUZ+kQvhICzAlt8ekA==","signatures":[{"sig":"MEYCIQCwTrTG6wS3imkGF6VGAiWrtH4oAnPArVdkncO6NIktcQIhAJX/ghZzRCYQkktyhx9Ocoa5Qz9a//uIbAiBWuk/rYoe","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":33628},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"6144fc87d0d0197fa85a4374f57bbac70c03c734","scripts":{"dev":"tsup --watch","lint":"eslint . --ext .ts,.js","test":"vitest","build":"tsup","version":"npm run build","lint:fix":"eslint . --ext .ts,.js --fix","test:run":"vitest run","typecheck":"tsc --noEmit","test:watch":"vitest --watch","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build && npm run test:run"},"_npmUser":{"name":"clewis8675309","email":"cory.lewis1997@gmail.com"},"repository":{"url":"git+https://github.com/mecharmor/jitterbug.git","type":"git"},"_npmVersion":"10.8.2","description":"A lightweight library for building reliable retry behavior in distributed systems and API clients","directories":{},"_nodeVersion":"20.20.0","_hasShrinkwrap":false,"devDependencies":{"jiti":"^2.6.1","tsup":"^8.5.1","eslint":"^9.39.2","vitest":"^1.2.0","globals":"^17.3.0","typescript":"^5.9.3","@types/node":"^25.2.0","typescript-eslint":"^8.54.0","@vitest/coverage-v8":"^1.2.0"},"_npmOperationalInternal":{"tmp":"tmp/jitterbug_1.0.0-alpha.5_1769980388921_0.4984999672991304","host":"s3://npm-registry-packages-npm-production"}},"1.0.0-alpha.6":{"name":"jitterbug","version":"1.0.0-alpha.6","keywords":["retry","retry-logic","api-client","distributed-systems"],"author":{"name":"Cory Lewis"},"license":"MIT","_id":"jitterbug@1.0.0-alpha.6","maintainers":[{"name":"clewis8675309","email":"cory.lewis1997@gmail.com"}],"homepage":"https://github.com/mecharmor/jitterbug#readme","bugs":{"url":"https://github.com/mecharmor/jitterbug/issues"},"dist":{"shasum":"e8e1cc1c0921d0375fabce2d0af9d2f506e5a58a","tarball":"https://registry.npmjs.org/jitterbug/-/jitterbug-1.0.0-alpha.6.tgz","fileCount":9,"integrity":"sha512-16uqIYA+dFY1DAnW0V1Zr96VhsBHRc8WlGODpiN5/Wj8wojjOn6QllLGUTHS1WWXzmMqF33EpY+xTwsMExsRsw==","signatures":[{"sig":"MEUCIQCh6IpWzp3+a2MDo5pig+kXQY2xzhYXHMbI2pZCQftfqQIgWKnX+WFW5z3Nh3GkAXbBiK4iEklzQwldghXogW4m9WM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":43277},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"f5a6c47636b3e7b7a4d8e045558408135a865237","scripts":{"dev":"tsup --watch","lint":"eslint . --ext .ts,.js","test":"vitest","build":"tsup","version":"npm run build","lint:fix":"eslint . --ext .ts,.js --fix","test:run":"vitest run","typecheck":"tsc --noEmit","test:watch":"vitest --watch","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build && npm run test:run"},"_npmUser":{"name":"clewis8675309","email":"cory.lewis1997@gmail.com"},"repository":{"url":"git+https://github.com/mecharmor/jitterbug.git","type":"git"},"_npmVersion":"10.8.2","description":"A lightweight library for building reliable retry behavior in distributed systems and API clients","directories":{},"_nodeVersion":"20.20.0","_hasShrinkwrap":false,"devDependencies":{"jiti":"^2.6.1","tsup":"^8.5.1","eslint":"^9.39.2","vitest":"^1.2.0","globals":"^17.3.0","typescript":"^5.9.3","@types/node":"^25.2.0","typescript-eslint":"^8.54.0","@vitest/coverage-v8":"^1.2.0"},"_npmOperationalInternal":{"tmp":"tmp/jitterbug_1.0.0-alpha.6_1769986354427_0.7989728735883632","host":"s3://npm-registry-packages-npm-production"}},"1.0.4-alpha.0":{"name":"jitterbug","version":"1.0.4-alpha.0","keywords":["retry","retries","retry-engine","retry-logic","backoff","exponential-backoff","linear-backoff","fixed-backoff","jitter","jitter-strategy","decorrelated-jitter","full-jitter","equal-jitter","random-jitter","network","resilience","resilient","api-client","distributed-systems","typescript","utility","async"],"author":{"name":"Cory Lewis"},"license":"MIT","_id":"jitterbug@1.0.4-alpha.0","maintainers":[{"name":"clewis8675309","email":"cory.lewis1997@gmail.com"}],"homepage":"https://github.com/mecharmor/jitterbug#readme","bugs":{"url":"https://github.com/mecharmor/jitterbug/issues"},"dist":{"shasum":"3ab2f6623cea12ebec672c8796d65727a8ad7065","tarball":"https://registry.npmjs.org/jitterbug/-/jitterbug-1.0.4-alpha.0.tgz","fileCount":9,"integrity":"sha512-lzVZ4BguQS3xDo0t65UiU51MHbhSVZ2vxn//8ksciM16+cQgetcSK278N4ioPCJ34ZIT3MffQopJbrG8cvXayQ==","signatures":[{"sig":"MEUCIDcA+8mhikjJSa2XHMuLpgvW4v03CZMqkH+6N+RCKXWYAiEAypxoOX+QPdWPrhp2dHK3RjJ200x8L8BEApCTQ4QmMyk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44097},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"d64490c6f14efa60634bfb8bfcfc9d6a257972de","scripts":{"dev":"tsup --watch","lint":"eslint . --ext .ts,.js","test":"vitest","build":"tsup","version":"npm run build","lint:fix":"eslint . --ext .ts,.js --fix","test:run":"vitest run","typecheck":"tsc --noEmit","test:watch":"vitest --watch","integration":"npm --prefix ./examples/basic test","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build && npm run test:run"},"_npmUser":{"name":"clewis8675309","email":"cory.lewis1997@gmail.com"},"repository":{"url":"git+https://github.com/mecharmor/jitterbug.git","type":"git"},"_npmVersion":"10.8.2","description":"A lightweight library for building reliable retry behavior in distributed systems and API clients","directories":{},"_nodeVersion":"20.20.0","_hasShrinkwrap":false,"devDependencies":{"jiti":"^2.6.1","tsup":"^8.5.1","eslint":"^9.39.2","vitest":"^1.2.0","globals":"^17.3.0","typescript":"^5.9.3","@types/node":"^25.2.0","typescript-eslint":"^8.54.0","@vitest/coverage-v8":"^1.2.0"},"_npmOperationalInternal":{"tmp":"tmp/jitterbug_1.0.4-alpha.0_1769990163903_0.48830221808168073","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"jitterbug","version":"1.0.6","description":"A lightweight library for building reliable retry behavior in distributed systems and API clients","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"type":"module","scripts":{"build":"tsup","dev":"tsup --watch","lint":"eslint . --ext .ts,.js","lint:fix":"eslint . --ext .ts,.js --fix","test":"vitest","test:run":"vitest run","test:coverage":"vitest run --coverage","test:watch":"vitest --watch","typecheck":"tsc --noEmit","prepublishOnly":"npm run build && npm run test:run","version":"npm run build","integration":"npm --prefix ./examples/basic test"},"devDependencies":{"@types/node":"^25.2.0","@vitest/coverage-v8":"^1.2.0","eslint":"^9.39.2","globals":"^17.3.0","jiti":"^2.6.1","tsup":"^8.5.1","typescript":"^5.9.3","typescript-eslint":"^8.54.0","vitest":"^1.2.0"},"keywords":["retry","retries","retry-engine","retry-logic","backoff","exponential-backoff","linear-backoff","fixed-backoff","jitter","jitter-strategy","decorrelated-jitter","full-jitter","equal-jitter","random-jitter","network","resilience","resilient","api-client","distributed-systems","typescript","utility","async"],"author":{"name":"Cory Lewis"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/mecharmor/jitterbug.git"},"_id":"jitterbug@1.0.6","gitHead":"6c5045c585633f60197555f98ee56a157b9f28f8","bugs":{"url":"https://github.com/mecharmor/jitterbug/issues"},"homepage":"https://github.com/mecharmor/jitterbug#readme","_nodeVersion":"20.20.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-nZK3Lg9NUDRltrDN/GRJLgR91tpvb5nByJcsFPFsoWe+qkXbfQAYZno8JsMeI6Wo1vYoHHuM+Yuyd9uAOQutPA==","shasum":"f29f2218ed1c1f96a7b3ca6a53af265117d7bf7f","tarball":"https://registry.npmjs.org/jitterbug/-/jitterbug-1.0.6.tgz","fileCount":9,"unpackedSize":44089,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBHK2lBMe62jCO66YDbHqHV7PoLjviP6GfIFWuQKcpkYAiBD0itW+aEM5Dv8iVk7V2E9jBmtTioHBnDIJviczF+YRw=="}]},"_npmUser":{"name":"clewis8675309","email":"cory.lewis1997@gmail.com"},"directories":{},"maintainers":[{"name":"clewis8675309","email":"cory.lewis1997@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/jitterbug_1.0.6_1769991070799_0.4597492967900201"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-01T19:15:47.278Z","modified":"2026-02-02T00:11:11.066Z","1.0.0":"2014-11-29T12:39:35.818Z","1.0.1":"2014-11-29T13:08:56.216Z","1.0.2":"2014-11-29T13:30:00.478Z","1.0.3":"2014-11-29T17:53:12.490Z","1.0.0-alpha.2":"2026-02-01T19:15:47.515Z","1.0.0-alpha.4":"2026-02-01T20:41:39.051Z","1.0.0-alpha.3":"2026-02-01T20:41:48.843Z","1.0.0-alpha.5":"2026-02-01T21:13:09.050Z","1.0.0-alpha.6":"2026-02-01T22:52:34.575Z","1.0.4-alpha.0":"2026-02-01T23:56:04.048Z","1.0.6":"2026-02-02T00:11:10.952Z"},"bugs":{"url":"https://github.com/mecharmor/jitterbug/issues"},"author":{"name":"Cory Lewis"},"license":"MIT","homepage":"https://github.com/mecharmor/jitterbug#readme","keywords":["retry","retries","retry-engine","retry-logic","backoff","exponential-backoff","linear-backoff","fixed-backoff","jitter","jitter-strategy","decorrelated-jitter","full-jitter","equal-jitter","random-jitter","network","resilience","resilient","api-client","distributed-systems","typescript","utility","async"],"repository":{"type":"git","url":"git+https://github.com/mecharmor/jitterbug.git"},"description":"A lightweight library for building reliable retry behavior in distributed systems and API clients","maintainers":[{"name":"clewis8675309","email":"cory.lewis1997@gmail.com"}],"readme":"![Jitterbug Logo](https://raw.githubusercontent.com/mecharmor/jitterbug/main/assets/logo.png)\n\n![Build Status](https://github.com/mecharmor/jitterbug/actions/workflows/build.yml/badge.svg?branch=main)\n![Tests](https://img.shields.io/github/actions/workflow/status/mecharmor/jitterbug/build.yml?branch=main&label=tests)\n[![npm version](https://img.shields.io/npm/v/jitterbug.svg)](https://www.npmjs.com/package/jitterbug)\n![License](https://img.shields.io/badge/license-MIT-blue.svg)\n![Integration Tests](https://img.shields.io/github/actions/workflow/status/mecharmor/jitterbug/build.yml?branch=main&label=integration)\n![Coverage](https://img.shields.io/badge/coverage-100.00%25-brightgreen)\n\n\nJitterbug is a modern, type‑safe retry engine for Node.js  and browser environments. It provides predictable backoff behavior and a suite of configurable jitter strategies, all wrapped in a clean, minimal API. The library is intentionally lightweight and dependency‑free to keep integration simple and reduce risk for consumers.\n\nDesigned to be framework‑agnostic and easy to adopt, Jitterbug emphasizes clarity, reliability, and maintainability. Its implementation is backed by comprehensive automated testing to ensure consistent behavior and to support confident contributions from the community.\n\n\n\n## Installation\n\n```bash\nnpm install jitterbug\n```\n\n## Usage\n\n### JavaScript/TypeScript\n\n```typescript\nimport { retry, type RetryOptions } from 'jitterbug';\n\n// Basic usage\nconst fetchWithRetry = retry(async (url) => {\n  const response = await fetch(url);\n  if (!response.ok) throw new Error('Request failed');\n  return response.json();\n});\n\n// With options\nconst fetchWithRetry = retry(async (url) => {\n  const response = await fetch(url);\n  if (!response.ok) throw new Error('Request failed');\n  return response.json();\n}, {\n  maxAttempts: 5,\n  delay: 1000,\n  backoff: 'exponential',\n  jitterConfig: { type: 'equal' }, // optional jitter\n  onRetry: (error, attempt, waitTime) => {\n    console.log(`Retry attempt ${attempt} after ${waitTime}ms`);\n  }\n});\n\n// Use it\ntry {\n  const data = await fetchWithRetry('https://api.example.com/data');\n  console.log(data);\n} catch (error) {\n  console.error('All retry attempts failed:', error);\n}\n```\n\n### Jitter Utility Functions\n\nJitterbug also exports its jitter calculation helpers directly.  \nThese functions are pure, deterministic (when `Math.random` is mocked), and can be used independently of the retry system.\n\n---\n\n#### **`calculateEqualJitter(baseDelayMs: number): number`**  \nProduces a delay between **50% and 100%** of the base delay.  \nUseful for predictable but desynchronized retry timing.\n\n---\n\n#### **`calculateFullJitter(minDelayMs: number, maxDelayMs: number): number`**  \nReturns a completely random delay between `minDelayMs` (inclusive) and `maxDelayMs` (exclusive).  \nIdeal for aggressively spreading retries under heavy load.\n\n---\n\n#### **`calculateFixedJitter(baseDelayMs: number, jitterAmount: number): number`**  \nSubtracts a constant amount from the base delay, never below zero.  \nUseful when you want consistent desynchronization without randomness.\n\n---\n\n#### **`calculateRandomJitter(baseDelayMs: number, jitterFraction: number): number`**  \nApplies a symmetric ±fraction jitter around the base delay.  \nExample: `fraction = 0.2` → delay may vary between 80% and 120% of the base.\n\n---\n\n#### **`calculateDecorrelatedJitter(baseDelayMs: number, maxDelayMs: number, prevDelayMs?: number): number`**  \nImplements AWS‑style decorrelated jitter.  \nEach retry picks a random delay between the base delay and **3× the previous delay**, capped at `maxDelayMs`.  \nExcellent for large distributed systems where synchronized retries can overwhelm downstream services.\n\n\n## API\n\n### `retry<T>(fn: T, options?: RetryOptions): T`\n\nCreates a retry wrapper function.\n\n**Parameters:**\n- `fn`: The async function to retry\n- `options`: Configuration object (optional)\n  - `maxAttempts` (number, default: 3): Maximum number of retry attempts\n  - `delay` (number, default: 1000): Base delay in milliseconds\n  - `backoff` ('exponential' | 'linear' | 'fixed', default: 'exponential'): Backoff strategy\n  - `jitterConfig` (`JitterConfig` | `undefined`): Optional jitter strategy applied on top of the base dela\n  - `onRetry` ((error: Error, attempt: number, waitTime: number) => void, optional): Callback called before each retry\n\n**Returns:** A function that wraps the original function with retry logic\n\n**TypeScript Types:**\n```typescript\nimport type { RetryOptions, BackoffStrategy } from 'jitterbug';\n```\n\n### Jitter Configuration Options\n\n- **`{ type: 'none' }`**  \n  No jitter applied. Retries use the exact backoff delay.\n\n- **`{ type: 'equal' }`**  \n  Splits the delay into a fixed half and a random half. Produces predictable but desynchronized retry timing.\n\n- **`{ type: 'full', min, max }`**  \n  Picks a completely random delay between `min` and `max`. Best for aggressively spreading retries under heavy load.\n\n- **`{ type: 'fixed', amount }`**  \n  Subtracts a constant amount from the base delay (never below zero). Useful for consistent, predictable desynchronization.\n\n- **`{ type: 'random', fraction }`**  \n  Applies a symmetric ±fraction jitter around the base delay (e.g., `0.2` = ±20%). Light, centered randomness.\n\n- **`{ type: 'decorrelated', maxDelay }`**  \n  AWS‑style decorrelated jitter. Each retry picks a random delay between the base delay and 3× the previous jittered delay, capped at `maxDelay`.\n\n\n## Test Coverage\n\n![Coverage](https://img.shields.io/badge/coverage-100.00%25-brightgreen)\n\n| Metric | Coverage |\n|--------|----------|\n| Statements | 100.00% |\n| Branches | 96.67% |\n| Functions | 100.00% |\n| Lines | 100.00% |\n\n\n## License\n\nMIT\n\n---\n\nretry, retries, retry engine, retry logic, backoff, exponential backoff, linear backoff, fixed backoff, jitter, jitter strategies, decorrelated jitter, full jitter, equal jitter, random jitter, resilience, network utilities, API clients, distributed systems, TypeScript utilities\n\n","readmeFilename":"README.md"}