{"id":13828987,"url":"https://github.com/mysticatea/abort-controller","last_synced_at":"2025-05-15T08:08:28.831Z","repository":{"id":46734689,"uuid":"105228556","full_name":"mysticatea/abort-controller","owner":"mysticatea","description":"An implementation of WHATWG AbortController interface.","archived":false,"fork":false,"pushed_at":"2021-03-30T17:01:33.000Z","size":115,"stargazers_count":307,"open_issues_count":23,"forks_count":34,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-29T23:39:06.993Z","etag":null,"topics":["abort-controller","cancellation","dom","javascript","library","nodejs","npm-module","npm-package","web","whatwg"],"latest_commit_sha":null,"homepage":"","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/mysticatea.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}},"created_at":"2017-09-29T04:05:44.000Z","updated_at":"2025-02-21T18:05:18.000Z","dependencies_parsed_at":"2022-09-10T20:00:16.077Z","dependency_job_id":null,"html_url":"https://github.com/mysticatea/abort-controller","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mysticatea%2Fabort-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mysticatea%2Fabort-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mysticatea%2Fabort-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mysticatea%2Fabort-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mysticatea","download_url":"https://codeload.github.com/mysticatea/abort-controller/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251795410,"owners_count":21645022,"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":["abort-controller","cancellation","dom","javascript","library","nodejs","npm-module","npm-package","web","whatwg"],"created_at":"2024-08-04T09:03:25.055Z","updated_at":"2025-05-15T08:08:28.782Z","avatar_url":"https://github.com/mysticatea.png","language":"TypeScript","readme":"# abort-controller\n\n[![npm version](https://img.shields.io/npm/v/abort-controller.svg)](https://www.npmjs.com/package/abort-controller)\n[![Downloads/month](https://img.shields.io/npm/dm/abort-controller.svg)](http://www.npmtrends.com/abort-controller)\n[![Build Status](https://travis-ci.org/mysticatea/abort-controller.svg?branch=master)](https://travis-ci.org/mysticatea/abort-controller)\n[![Coverage Status](https://codecov.io/gh/mysticatea/abort-controller/branch/master/graph/badge.svg)](https://codecov.io/gh/mysticatea/abort-controller)\n[![Dependency Status](https://david-dm.org/mysticatea/abort-controller.svg)](https://david-dm.org/mysticatea/abort-controller)\n\nAn implementation of [WHATWG AbortController interface](https://dom.spec.whatwg.org/#interface-abortcontroller).\n\n```js\nimport AbortController from \"abort-controller\"\n\nconst controller = new AbortController()\nconst signal = controller.signal\n\nsignal.addEventListener(\"abort\", () =\u003e {\n    console.log(\"aborted!\")\n})\n\ncontroller.abort()\n```\n\n\u003e https://jsfiddle.net/1r2994qp/1/\n\n## 💿 Installation\n\nUse [npm](https://www.npmjs.com/) to install then use a bundler.\n\n```\nnpm install abort-controller\n```\n\nOr download from [`dist` directory](./dist).\n\n- [dist/abort-controller.mjs](dist/abort-controller.mjs) ... ES modules version.\n- [dist/abort-controller.js](dist/abort-controller.js) ... Common JS version.\n- [dist/abort-controller.umd.js](dist/abort-controller.umd.js) ... UMD (Universal Module Definition) version. This is transpiled by [Babel](https://babeljs.io/) for IE 11.\n\n## 📖 Usage\n\n### Basic\n\n```js\nimport AbortController from \"abort-controller\"\n// or\nconst AbortController = require(\"abort-controller\")\n\n// or UMD version defines a global variable:\nconst AbortController = window.AbortControllerShim\n```\n\nIf your bundler recognizes `browser` field of `package.json`, the imported `AbortController` is the native one and it doesn't contain shim (even if the native implementation was nothing).\nIf you wanted to polyfill `AbortController` for IE, use `abort-controller/polyfill`.\n\n### Polyfilling\n\nImporting `abort-controller/polyfill` assigns the `AbortController` shim to the `AbortController` global variable if the native implementation was nothing.\n\n```js\nimport \"abort-controller/polyfill\"\n// or\nrequire(\"abort-controller/polyfill\")\n```\n\n### API\n\n#### AbortController\n\n\u003e https://dom.spec.whatwg.org/#interface-abortcontroller\n\n##### controller.signal\n\nThe [AbortSignal](https://dom.spec.whatwg.org/#interface-AbortSignal) object which is associated to this controller.\n\n##### controller.abort()\n\nNotify `abort` event to listeners that the `signal` has.\n\n## 📰 Changelog\n\n- See [GitHub releases](https://github.com/mysticatea/abort-controller/releases).\n\n## 🍻 Contributing\n\nContributing is welcome ❤️\n\nPlease use GitHub issues/PRs.\n\n### Development tools\n\n- `npm install` installs dependencies for development.\n- `npm test` runs tests and measures code coverage.\n- `npm run clean` removes temporary files of tests.\n- `npm run coverage` opens code coverage of the previous test with your default browser.\n- `npm run lint` runs ESLint.\n- `npm run build` generates `dist` codes.\n- `npm run watch` runs tests on each file change.\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmysticatea%2Fabort-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmysticatea%2Fabort-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmysticatea%2Fabort-controller/lists"}