{"name":"race-signal","version":"1.1.2","author":{"name":"Alex Potsides","email":"alex@achingbrain.net"},"license":"Apache-2.0 OR MIT","_id":"race-signal@1.1.2","homepage":"https://github.com/achingbrain/race-signal#readme","bugs":{"url":"https://github.com/achingbrain/race-signal/issues"},"dist":{"shasum":"ac4be02fb09b0ffca2df0fd8ed34edfaed54948b","tarball":"http://registry-npm.ywwl.com/race-signal/download/race-signal-1.1.2.tgz","fileCount":10,"integrity":"sha512-zXhuPZJeYIFO2TZLOtFxdG2/SJ2mG24WnvWTrj5HZEftMG594MT8ZSVQFrciNa0XRbuhl2fkruuzKflzmm6LnQ==","signatures":[{"sig":"MEUCIQDLgxdnnDch18jEDhOmQwRlmMlYTKbdBOKRSqkzsr3TnQIgGDWGFR0WzptgWItKUS36KbikHzhiCOvduOt2zOC55lo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13589,"size":4258,"noattachment":false,"key":"/race-signal/-/race-signal-1.1.2.tgz"},"type":"module","types":"./dist/src/index.d.ts","exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"}},"gitHead":"e44dba9a5b6611b9762cbdf2bcb1f5fb65ec76ca","release":{"plugins":[["@semantic-release/commit-analyzer",{"preset":"conventionalcommits","releaseRules":[{"release":"major","breaking":true},{"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"],"branches":["main"]},"scripts":{"docs":"aegir docs","lint":"aegir lint","test":"aegir test","build":"aegir build","clean":"aegir clean","release":"aegir release","dep-check":"aegir dep-check","test:node":"aegir test -t node --cov","test:chrome":"aegir test -t browser --cov","test:firefox":"aegir test -t browser -- --browser firefox","test:chrome-webworker":"aegir test -t webworker","test:firefox-webworker":"aegir test -t webworker -- --browser firefox"},"_npmUser":{"name":"achingbrain","email":"alex@achingbrain.net"},"repository":{"url":"git+https://github.com/achingbrain/race-signal.git","type":"git"},"_npmVersion":"10.9.2","description":"Race a promise against an AbortSignal","directories":{},"_nodeVersion":"22.13.1","eslintConfig":{"extends":"ipfs","parserOptions":{"sourceType":"module"}},"_hasShrinkwrap":false,"devDependencies":{"aegir":"^45.0.8"},"_npmOperationalInternal":{"tmp":"tmp/race-signal_1.1.2_1740156335023_0.2886944043792403","host":"s3://npm-registry-packages-npm-production"},"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":1740156335248,"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"}],"_cnpm_publish_time":1740156335248,"dist-tags":{"latest":"2.0.2"}}