{"name":"native-abort-controller","version":"0.0.2","description":"Returns native AbortController/AbortSignal if available or the abort-controller module if not","main":"src/index.js","scripts":{"test":"aegir test -t node -t browser -t webworker -t electron-main -t electron-renderer","lint":"aegir lint","release":"aegir release --docs false","release-minor":"aegir release --type minor --docs false","release-major":"aegir release --type major --docs false"},"author":{"name":"Alex Potsides","email":"alex@achingbrain.net"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/achingbrain/native-abort-controller.git"},"dependencies":{},"peerDependencies":{"abort-controller":"*"},"devDependencies":{"abort-controller":"^3.0.0","aegir":"^26.0.0","globalthis":"^1.0.1"},"contributors":[{"name":"achingbrain","email":"alex@achingbrain.net"}],"gitHead":"4d8c0c50ca72bf29a755650527c302f0d257de43","bugs":{"url":"https://github.com/achingbrain/native-abort-controller/issues"},"homepage":"https://github.com/achingbrain/native-abort-controller#readme","_id":"native-abort-controller@0.0.2","_nodeVersion":"12.16.1","_npmVersion":"6.14.1","dist":{"integrity":"sha512-/qUHwEJPkFDG+Qf/yabBGioU1iYTFn7Qpz/AHfURw0He30dzCaxssLuj3/bVzFyboKz+SEMloLy/iKhUBM2IEg==","shasum":"80c554e4154551efad79b8736d1490c8834f8acf","tarball":"http://registry-npm.ywwl.com/native-abort-controller/download/native-abort-controller-0.0.2.tgz","fileCount":5,"unpackedSize":4673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSNt0CRA9TVsSAnZWagAAZqoQAJnWkhRxrAL46Echq8I+\nRnz4qqotL2L30bwt9iXNFlfpExJbC419AiKOF5nkVqC5RwMury6t7cQNcG9z\n3jHvz0QU1aejpJudTd28P5t+9t8X2U7e7/fW43Taf+Op7uBEsADsOqfDx6FQ\nFrLtbyS86YLWFs4lJmbwM3Qle09mta0WN0COCcXrj/KU10ZYMv1xsTd0NgS9\n2Vh3XeATSOV7qfRJp2cIG5SXXtcf5fwaJEy9L3myZyThwSBNcejSoWdA+7tt\nQuMCTQfFnng4MFvUgNv5jpod5t4HZlPuVdQAawzWqqkmrY7HDW2xvAI31ire\nVpn6AHSgxFnXO/bL/XNpDoVLZ5cXY+IfHRAcIVfBAHePuzJmUIvv7A4+7iUE\nDBFPgR7aBP6QHbvDkVt6pTs3dCpwRuD4z1bYzhLmx85s+z9XYUiJoeZ/YaQ1\n81NfFgZs+JyFSvwgdL8d9GkCFmiUn3ei8RHSdX7FqOmkS2zzp+3LQhJN/e1l\n6P6G1nO0xBmgwiVCwNdgz7NfjTKvkXOQX/YmRNy1CNRkoxt1R8aryYOQLUav\noE+JdQpmx7zpHLwJ2atC0bOzC1sgdrCe1aQ/1Z7We2SV5FYVLUsKABSuei02\nDGKjRdwlrfYdmr/r7J/5hy3SHE63iCECyNEJGoryoKnoej0Qiafig3C70LKx\nBT/M\r\n=C9jL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmM7iUSEU991x5tpNcE9Kr0MHwQvK+8lkdYcN+2T5oDAIgGvdAS/lKh/PhnEujcOB/m3NZHYQI6KMpAcsyGVK3UjA="}],"size":1701,"noattachment":false,"key":"/native-abort-controller/-/native-abort-controller-0.0.2.tgz"},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"}],"_npmUser":{"name":"achingbrain","email":"alex@achingbrain.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/native-abort-controller_0.0.2_1598610292170_0.01612347159296723"},"_hasShrinkwrap":false,"readme":"# native-abort-controller\n\n> Returns native AbortController/AbortSignal if available or the abort-controller module if not\n\nAn (almost) drop-in replacement for the `abort-controller` module that returns the native AbortController if available or the polyfill if not.\n\n### Why?\n\nSome environments such as the Electron Renderer process straddle the node/browser divide with features from both APIs available.  In these cases the webpack approach of always using the `browser` field in your `package.json` to override requires is too heavy-handed as sometimes you want to use the node version of an API.\n\nInstead we can check for the availability of a given API and return it, rather than the node-polyfill for that API.\n\nThis module may become unecessary if [mysticatea/abort-controller#24](https://github.com/mysticatea/abort-controller/issues/24) is resolved.\n\n## Install\n\nYou must install a version of `abort-controller` [alongside this module](https://docs.npmjs.com/files/package.json#peerdependencies) to be used if a native implementation is not available.\n\n```console\n$ npm install --save native-abort-controller abort-controller\n```\n\n## Usage\n\n```javascript\nimport { AbortController } from 'native-abort-controller'\n\nconst controller = new AbortController()\nconst signal = controller.signal\n\nsignal.addEventListener('abort', () => {\n    console.log('aborted!')\n})\n\ncontroller.abort()\n```\n","publish_time":1598610292298,"_cnpm_publish_time":1598610292298,"dist-tags":{"latest":"1.0.4"}}