{"id":29012430,"url":"https://github.com/stephenhebert/axios-plugins","last_synced_at":"2026-01-29T05:07:27.926Z","repository":{"id":297150372,"uuid":"995828963","full_name":"stephenhebert/axios-plugins","owner":"stephenhebert","description":"A collection of Axios plugins for enhanced functionality","archived":false,"fork":false,"pushed_at":"2025-06-04T05:54:40.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-05T07:19:09.412Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@stephenhebert/axios-plugins","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/stephenhebert.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-04T04:22:58.000Z","updated_at":"2025-06-11T04:28:47.000Z","dependencies_parsed_at":"2025-06-04T10:10:11.994Z","dependency_job_id":"9b908fe1-09bb-44f8-93ab-d5db16f9a098","html_url":"https://github.com/stephenhebert/axios-plugins","commit_stats":null,"previous_names":["stephenhebert/axios-plugins"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/stephenhebert/axios-plugins","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenhebert%2Faxios-plugins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenhebert%2Faxios-plugins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenhebert%2Faxios-plugins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenhebert%2Faxios-plugins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stephenhebert","download_url":"https://codeload.github.com/stephenhebert/axios-plugins/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenhebert%2Faxios-plugins/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28863182,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T22:56:21.783Z","status":"online","status_checked_at":"2026-01-29T02:00:06.714Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-06-25T18:36:20.590Z","updated_at":"2026-01-29T05:07:27.922Z","avatar_url":"https://github.com/stephenhebert.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @stephenhebert/axios-plugins\n\nA collection of Axios plugins for enhanced functionality.\n\n## Features\n\n- **Allow 404 Responses**: Handle 404 responses gracefully without throwing errors.\n- **Inflight Cache**: Prevent duplicate requests by caching inflight requests.\n- **Get All Pages**: Automatically fetch paginated API results.\n\n## Installation\n\nInstall the package via npm:\n\n```bash\nnpm install @stephenhebert/axios-plugins\n```\n\n## Usage\n\n### Allow 404 Responses\n\nEnable the `allow404` plugin to handle 404 responses gracefully:\n\n```ts\nimport axios from 'axios'\nimport { allow404 } from '@stephenhebert/axios-plugins'\n\nconst client = axios.create({\n  plugins: {\n    allow404: true,\n  },\n})\n\nallow404.install(client)\n\nclient.get('http://example.com/api/data')\n  .then(response =\u003e console.log(response.status)) // 404\n  .catch(error =\u003e console.error(error))\n```\n\n### Inflight Cache\n\nPrevent duplicate requests by enabling the `inflightCache` plugin:\n\n```ts\nimport axios from 'axios'\nimport { inflightCache } from '@stephenhebert/axios-plugins'\n\nconst client = axios.create({\n  plugins: {\n    inflightCache: true,\n  },\n})\n\ninflightCache.install(client)\n\nclient.get('http://example.com/api/data')\n  .then(response =\u003e console.log(response.data))\n```\n\n### Get All Pages\n\nAutomatically fetch all paginated results:\n\n```ts\nimport axios from 'axios'\nimport { getAllPages } from '@stephenhebert/axios-plugins'\n\nconst client = axios.create()\n\ngetAllPages.install(client)\n\nclient.get('http://example.com/api/data', {\n    plugins: {\n      getAllPages: true,\n    },\n  })\n  .then(response =\u003e console.log(response.data))\n```\n\n### With Abort Controller\n\nWrap request callback in factory decorator to handle aborting previous requests when subsequent requests are made:\n\n```ts\nimport axios from 'axios'\nimport { withAbortController } from '@stephenhebert/axios-plugins'\n\nconst client = axios.create()\n\nconst fetchData = withAbortController( async (signal) =\u003e { \n  try {\n    await client.get('http://example.com/api/data', { signal } )\n  }\n  catch (error) {}\n})\n\nfetchData() // starts first request\nfetchData() // cancels first request and starts second request\n\n\n```\n\n## Development\n\n### Build\n\nRun the following command to build the project:\n\n```bash\nnpm run build\n```\n\n### Test\n\nRun the tests using Vitest:\n\n```bash\nnpm run test\n```\n\n### Lint\n\nLint the codebase using ESLint:\n\n```bash\nnpm run lint\n```\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request on [GitHub](https://github.com/stephenhebert/axios-plugins).\n\n## Keywords\n\n- axios\n- plugins\n- middleware\n- interceptors\n- http\n- typescript\n- javascript\n- api\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephenhebert%2Faxios-plugins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephenhebert%2Faxios-plugins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephenhebert%2Faxios-plugins/lists"}