{"name":"race-signal","version":"1.1.3","description":"Race a promise against an AbortSignal","author":{"name":"Alex Potsides","email":"alex@achingbrain.net"},"license":"Apache-2.0 OR MIT","homepage":"https://github.com/achingbrain/race-signal#readme","repository":{"type":"git","url":"git+https://github.com/achingbrain/race-signal.git"},"bugs":{"url":"https://github.com/achingbrain/race-signal/issues"},"type":"module","types":"./dist/src/index.d.ts","exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"}},"eslintConfig":{"extends":"ipfs","parserOptions":{"sourceType":"module"}},"release":{"branches":["main"],"plugins":[["@semantic-release/commit-analyzer",{"preset":"conventionalcommits","releaseRules":[{"breaking":true,"release":"major"},{"revert":true,"release":"patch"},{"type":"feat","release":"minor"},{"type":"fix","release":"patch"},{"type":"docs","release":"patch"},{"type":"test","release":"patch"},{"type":"deps","release":"patch"},{"scope":"no-release","release":false}]}],["@semantic-release/release-notes-generator",{"preset":"conventionalcommits","presetConfig":{"types":[{"type":"feat","section":"Features"},{"type":"fix","section":"Bug Fixes"},{"type":"chore","section":"Trivial Changes"},{"type":"docs","section":"Documentation"},{"type":"deps","section":"Dependencies"},{"type":"test","section":"Tests"}]}}],"@semantic-release/changelog","@semantic-release/npm","@semantic-release/github","@semantic-release/git"]},"scripts":{"clean":"aegir clean","lint":"aegir lint","build":"aegir build","test":"aegir test","test:node":"aegir test -t node --cov","test:chrome":"aegir test -t browser --cov","test:chrome-webworker":"aegir test -t webworker","test:firefox":"aegir test -t browser -- --browser firefox","test:firefox-webworker":"aegir test -t webworker -- --browser firefox","release":"aegir release","dep-check":"aegir dep-check","docs":"aegir docs"},"devDependencies":{"aegir":"^45.0.8"},"_id":"race-signal@1.1.3","gitHead":"62dac29e756bd59630681fd52fe5de35ee3a98d1","_nodeVersion":"22.13.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-Mt2NznMgepLfORijhQMncE26IhkmjEphig+/1fKC0OtaKwys/gpvpmswSjoN01SS+VO951mj0L4VIDXdXsjnfA==","shasum":"688c117d626161abfd5ee6d9b5d84bd59df54ee5","tarball":"http://registry-npm.ywwl.com/race-signal/download/race-signal-1.1.3.tgz","fileCount":10,"unpackedSize":12939,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCyAmapqauEQUKarPhZ1uIJp17Cbg+zdllrSIAvrs0+zgIgRf3ss7JDLUAl1G8pl/ffJzaBN3rWdJ77rEaD+1uWP70="}],"size":4122,"noattachment":false,"key":"/race-signal/-/race-signal-1.1.3.tgz"},"_npmUser":{"name":"achingbrain","email":"alex@achingbrain.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/race-signal_1.1.3_1740302799447_0.2759768794255897"},"_hasShrinkwrap":false,"readme":"# race-signal <!-- omit in toc -->\n\n[![codecov](https://img.shields.io/codecov/c/github/achingbrain/race-signal.svg?style=flat-square)](https://codecov.io/gh/achingbrain/race-signal)\n[![CI](https://img.shields.io/github/actions/workflow/status/achingbrain/race-signal/js-test-and-release.yml?branch=main\\&style=flat-square)](https://github.com/achingbrain/race-signal/actions/workflows/js-test-and-release.yml?query=branch%3Amain)\n\n> Race a promise against an AbortSignal\n\n## Table of contents <!-- omit in toc -->\n\n- [Install](#install)\n  - [Browser `<script>` tag](#browser-script-tag)\n- [Example](#example)\n- [API Docs](#api-docs)\n- [License](#license)\n- [Contribution](#contribution)\n\n## Install\n\n```console\n$ npm i race-signal\n```\n\n### Browser `<script>` tag\n\nLoading this module through a script tag will make it's exports available as `RaceSignal` in the global namespace.\n\n```html\n<script src=\"https://unpkg.com/race-signal/dist/index.min.js\"></script>\n```\n\n## Example\n\n```js\nconst { raceSignal } = require('race-signal')\n\nconst controller = new AbortController()\n\nconst promise = new Promise((resolve, reject) => {\n  setTimeout(() => {\n    resolve('a value')\n  }, 1000)\n})\n\nsetTimeout(() => {\n  controller.abort()\n}, 500)\n\n// throws an AbortError\nconst resolve = await raceSignal(promise, controller.signal)\n```\n\n## API Docs\n\n- <https://achingbrain.github.io/race-signal>\n\n## License\n\nLicensed under either of\n\n- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)\n- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n","publish_time":1740302799666,"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"}],"_cnpm_publish_time":1740302799666,"dist-tags":{"latest":"2.0.2"}}