{"id":13772337,"url":"https://github.com/mo/abortcontroller-polyfill","last_synced_at":"2026-03-17T20:02:40.443Z","repository":{"id":37664129,"uuid":"98086783","full_name":"mo/abortcontroller-polyfill","owner":"mo","description":"Polyfill for the AbortController DOM API and abortable fetch (stub that calls catch, doesn't actually abort request).","archived":false,"fork":false,"pushed_at":"2024-12-10T16:37:13.000Z","size":1354,"stargazers_count":340,"open_issues_count":16,"forks_count":31,"subscribers_count":5,"default_branch":"master","last_synced_at":"2026-03-12T16:40:55.228Z","etag":null,"topics":["abortcontroller","abortsignal","fetch","javascript","polyfill","ponyfill"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/mo.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-07-23T09:11:26.000Z","updated_at":"2026-02-06T06:25:33.000Z","dependencies_parsed_at":"2024-02-12T04:36:35.995Z","dependency_job_id":"c5905d95-04bb-4022-9c7b-13b928b2cf92","html_url":"https://github.com/mo/abortcontroller-polyfill","commit_stats":{"total_commits":173,"total_committers":12,"mean_commits":"14.416666666666666","dds":0.161849710982659,"last_synced_commit":"5fd96cf929d75999db533d578c5f0bc161df552e"},"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"purl":"pkg:github/mo/abortcontroller-polyfill","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mo%2Fabortcontroller-polyfill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mo%2Fabortcontroller-polyfill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mo%2Fabortcontroller-polyfill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mo%2Fabortcontroller-polyfill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mo","download_url":"https://codeload.github.com/mo/abortcontroller-polyfill/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mo%2Fabortcontroller-polyfill/sbom","scorecard":{"id":655110,"data":{"date":"2025-08-11","repo":{"name":"github.com/mo/abortcontroller-polyfill","commit":"b5c6843c03901088fbdd76df7ab775cb2e0cf2c4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 1/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"15 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-pq67-2wwv-3xjx","Warn: Project is vulnerable to: GHSA-8cj5-5rvv-wf4v","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-c76h-2ccp-4975","Warn: Project is vulnerable to: GHSA-cxrh-j4jr-qwg3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T14:27:03.910Z","repository_id":37664129,"created_at":"2025-08-21T14:27:03.910Z","updated_at":"2025-08-21T14:27:03.910Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30630027,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["abortcontroller","abortsignal","fetch","javascript","polyfill","ponyfill"],"created_at":"2024-08-03T17:01:02.736Z","updated_at":"2026-03-17T20:02:40.405Z","avatar_url":"https://github.com/mo.png","language":"JavaScript","readme":"# AbortController polyfill for abortable fetch()\n\n[![npm version](https://badge.fury.io/js/abortcontroller-polyfill.svg)](https://badge.fury.io/js/abortcontroller-polyfill)\n\nMinimal stubs so that the AbortController DOM API for terminating ```fetch()``` requests can be used\nin browsers that doesn't yet implement it. This \"polyfill\" doesn't actually close the connection\nwhen the request is aborted, but it will call ```.catch()``` with ```err.name == 'AbortError'```\ninstead of ```.then()```.\n\n```js\nconst controller = new AbortController();\nconst signal = controller.signal;\nfetch('/some/url', {signal})\n  .then(res =\u003e res.json())\n  .then(data =\u003e {\n    // do something with \"data\"\n  }).catch(err =\u003e {\n    if (err.name == 'AbortError') {\n      return;\n    }\n  });\n// controller.abort(); // can be called at any time\n```\n\nYou can read about the [AbortController](https://dom.spec.whatwg.org/#aborting-ongoing-activities) API in the DOM specification.\n\n# How to use\n\n```shell\n$ npm install --save abortcontroller-polyfill\n```\n\nIf you're using webpack or similar, you then import it early in your client entrypoint .js file using\n\n```js\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch'\n// or:\nrequire('abortcontroller-polyfill/dist/polyfill-patch-fetch')\n```\n\n## Using it on browsers without fetch\n\nIf you need to support browsers where fetch is not available at all (for example\nInternet Explorer 11), you first need to install a fetch polyfill and then\nimport the ```abortcontroller-polyfill``` afterwards.\n\nThe [unfetch](https://www.npmjs.com/package/unfetch) npm package offers a minimal ```fetch()```\nimplementation (though it does not offer for example a ```Request``` class). If you need a polyfill that\nimplements the full Fetch specification, use the\n[whatwg-fetch](https://www.npmjs.com/package/whatwg-fetch) npm package instead. Typically you will\nalso need to load a polyfill that implements ES6 promises, for example\n[promise-polyfill](https://www.npmjs.com/package/promise-polyfill), and of course you need to avoid\nES6 arrow functions and template literals.\n\nExample projects showing abortable fetch setup so that it works even in Internet Explorer 11, using\nboth unfetch and GitHub fetch, is available\n[here](https://github.com/mo/abortcontroller-polyfill-examples).\n\n## Using it along with 'create-react-app'\n\ncreate-react-app enforces the no-undef eslint rule at compile time so if your\nversion of eslint does not list ```AbortController``` etc as a known global for\nthe ```browser``` environment, then you might run into an compile error like:\n\n```\n  'AbortController' is not defined  no-undef\n```\n\nThis can be worked around by (temporarily, details [here](https://github.com/mo/abortcontroller-polyfill/issues/10)) adding a declaration like:\n\n```js\n  const AbortController = window.AbortController;\n```\n\n## Using the AbortController/AbortSignal without patching fetch\n\nIf you just want to polyfill AbortController/AbortSignal without patching fetch\nyou can use:\n\n```js\nimport 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'\n```\n\n# Using it on Node.js\n\nYou can either import it as a [ponyfill](https://ponyfill.com/) without modifying globals:\n\n```js\nconst { AbortController, abortableFetch } = require('abortcontroller-polyfill/dist/cjs-ponyfill');\nconst { fetch } = abortableFetch(require('node-fetch'));\n// or\n// import { AbortController, abortableFetch } from 'abortcontroller-polyfill/dist/cjs-ponyfill';\n// import _fetch from 'node-fetch';\n// const { fetch } = abortableFetch(_fetch);\n```\nor if you're lazy\n```js\nglobal.fetch = require('node-fetch');\nrequire('abortcontroller-polyfill/dist/polyfill-patch-fetch');\n```\n\nIf you also need a ```Request``` class with support for aborting you can do:\n\n```js\nconst { AbortController, abortableFetch } = require('abortcontroller-polyfill/dist/cjs-ponyfill');\nconst _nodeFetch = require('node-fetch');\nconst { fetch, Request } = abortableFetch({fetch: _nodeFetch, Request: _nodeFetch.Request});\n\nconst controller = new AbortController();\nconst signal = controller.signal;\ncontroller.abort();\nfetch(Request(\"http://api.github.com\", {signal}))\n  .then(r =\u003e r.json())\n  .then(j =\u003e console.log(j))\n  .catch(err =\u003e {\n      if (err.name === 'AbortError') {\n          console.log('aborted');\n      }\n  })\n```\n\nSee also Node.js examples [here](https://github.com/mo/abortcontroller-polyfill-examples/tree/master/node)\n\n# Using it on Internet Explorer 11 (MSIE11)\n\nThe ```abortcontroller-polyfill``` works on Internet Explorer 11. However, to use it you must first\ninstall separate polyfills for promises and for ```fetch()```. For the promise polyfill, you can\nuse the ```promise-polyfill``` package from npm, and for ```fetch()``` you can use either the ```whatwg-fetch``` npm package (complete fetch implementation) or the ```unfetch``` npm package (not a complete polyfill but it's only 500 bytes large and covers a lot of the basic use cases).\n\nIf you choose ```unfetch```, the imports should be done in this order for example:\n\n```js\nimport 'promise-polyfill/src/polyfill';\nimport 'unfetch/polyfill';\nimport 'abortcontroller-polyfill';\n```\n\nSee example code [here](https://github.com/mo/abortcontroller-polyfill-examples/tree/master/create-react-app-msie11).\n\n# Using it on Internet Explorer 8 (MSIE8)\n\nThe ```abortcontroller-polyfill``` works on Internet Explorer 8. However, since ```github-fetch```\nonly supports IE 10+ you need to use the ```fetch-ie8``` npm package instead and also note that IE 8 only\nimplements ES 3 so you need to use the ```es5-shim``` package (or similar). Finally, just like with\nIE 11 you also need to polyfill promises. One caveat is that CORS requests will not work out of the box on IE 8.\n\nHere is a basic example of [abortable fetch running in IE 8](https://github.com/mo/abortcontroller-polyfill-examples/tree/master/plain-javascript-fetch-ie8).\n\n# Using it on Legacy Webview\n\nThe ```abortcontroller-polyfill``` works on Legacy Webview. However, to use it you must first confirm that the native AbortController and AbortSignal already exist in the environment. Otherwise, it is recommended to use the other solutions mentioned above.\n\n```js\nimport 'abortcontroller-polyfill/dist/abortsignal-polyfill-only';\n```\n\n# Contributors\n* [Martin Olsson](https://github.com/mo)\n* [Jimmy Wärting](https://github.com/jimmywarting)\n* [silverwind](https://github.com/silverwind)\n* [Rasmus Jacobsen](https://github.com/rmja)\n* [João Vieira](https://github.com/joaovieira)\n* [Cyril Auburtin](https://github.com/caub)\n* [Leonardo Apiwan](https://github.com/homer0)\n* [Jake Champion](https://github.com/JakeChampion)\n* [Sai Srinivasan](https://github.com/SairamSrinivasan)\n* [Ambar Lee](https://github.com/ambar)\n* [Sebastian Silbermann](https://github.com/eps1lon)\n* [Yao Shi](https://github.com/TechQuery)\n* [Ray Hao](https://github.com/l246804)\n\n# License\n\nMIT\n","funding_links":[],"categories":["Browser Features"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmo%2Fabortcontroller-polyfill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmo%2Fabortcontroller-polyfill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmo%2Fabortcontroller-polyfill/lists"}