{"name":"@azure/abort-controller","version":"1.0.1-dev.20200213.1","keywords":["Azure","Aborter","AbortSignal","Cancellation","Node.js","TypeScript","JavaScript","Browser"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/abort-controller@1.0.1-dev.20200213.1","maintainers":[{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/abort-controller","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"5a7b8f7b78e26380d434b2d3f37cb6f288d0a5ce","tarball":"http://registry-npm.ywwl.com/@azure/abort-controller/download/@azure/abort-controller-1.0.1-dev.20200213.1.tgz","fileCount":23,"integrity":"sha512-GlfnqV6LhB7N2GZ107R6i68YaeeQP3EsLmrV2Ifa5PfXVObFQv+zMERYFfbLdABhhWmEkoCgCN9dgfMF79dAlw==","signatures":[{"sig":"MEQCIEAhW3/G6gQlX9nLxlQwfpKxK+tpyBU36SPCzJOBYdrNAiBQ/7kxZtW8OKtx1s43FxBRJVhxTGETIiV7raA7/u5NXw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":60758,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeRVnUCRA9TVsSAnZWagAAoZEP/2pwSOFrx/7pLYpt2ggr\nki/CWgUv8I57mVcG6HOWARpI8sVzGXOV7sJanG6j9Ls6sXytIDkUnIRNpAh+\nrmlH06qx7eS8G4zAYyOtjIsrhvGmFxvp1YNpc77R9tIN92OhHYnupuZQHQZY\nHzO221tExOSibXfQpVPPdEwNo8Q7nnITYoecNRov28VifND9282/a5+3l7lP\nAtz1s5jjlp9Wr+W4xr9nuWcsjfQPH7HnlAgTtWtXnfHPfLS0H+FOcmbQ8gqr\nPU5OOTn5gzeE1U8qcLAeRsZ+kCjWlVhNJTygMCgU8WLcJnZ4KZSwivlW8+0/\nAl7qO1aWbRGcbHlOlNznqQGFHKNbn+eidCW1+tiVKQmNAXPQFMMZWhJJWzAG\n4V9w/JBqrdvQH004KQhXsQGJYwV8CGDmfWp2UwRwCJrNLu7bn+zu4WdFOuJT\nUQQmjvehMmLDOdVMIn8muR0pZ6lygFJN/cL+plw6Drd3TTD16DGHN3dUE/xx\nnPx8figk/AdoPfuMdlgysm1Yufclct4uKm03oOX3txlsMVhaFxW78qMxMIya\nUB2gKccAQ/piyk8XJOEi/eLrD0FT328fVd8TY5KZgFFaKq57f4nBD24CYH/p\nATvuhqUaOhcZPARSeyx9LtVVXBaxYw0tT6B4p+2BpAD6SSfOZEOtb1kdwRXi\nJpd8\r\n=tOuP\r\n-----END PGP SIGNATURE-----\r\n","size":12523,"noattachment":false,"key":"/@azure/abort-controller/-/@azure/abort-controller-1.0.1-dev.20200213.1.tgz"},"main":"./dist/index.js","_from":"file:/home/vsts/work/1/packages/azure-abort-controller-1.0.1-dev.20200213.1.tgz","types":"./types/src/aborter.d.ts","engine":{"node":">=8.0.0"},"module":"./dist-esm/src/aborter.js","readme":"# Azure Abort Controller library for JavaScript\n\nThe `@azure/abort-controller` package provides `AbortController` and `AbortSignal` classes. These classes are compatible\nwith the [AbortController](https://developer.mozilla.org/docs/Web/API/AbortController) built into modern browsers\nand the `AbortSignal` used by [fetch](https://developer.mozilla.org/docs/Web/API/Fetch_API).\nUse the `AbortController` class to create an instance of the `AbortSignal` class that can be used to cancel an operation\nin an Azure SDK that accept a parameter of type `AbortSignalLike`.\n\n## Getting started\n\n### Installation\n\nInstall this libray using npm as follows\n\n```\nnpm install @azure/abort-controller\n```\n\n## Key Concepts\n\nUse the `AbortController` to create an `AbortSignal` which can then be passed to Azure SDK operations to cancel\npending work. The `AbortSignal` can be accessed via the `signal` property on an instantiated `AbortController`.\nAn `AbortSignal` can also be returned directly from a static method, e.g. `AbortController.timeout(100)`.\nthat is cancelled after 100 milliseconds.\n\nCalling `abort()` on the instantiated `AbortController` invokes the registered `abort`\nevent listeners on the associated `AbortSignal`.\nAny subsequent calls to `abort()` on the same controller will have no effect.\n\nThe `AbortSignal.none` static property returns an `AbortSignal` that can not be aborted.\n\nMultiple instances of an `AbortSignal` can be linked so that calling `abort()` on the parent signal,\naborts all linked signals.\nThis linkage is one-way, meaning that a parent signal can affect a linked signal, but not the other way around.\nTo link `AbortSignals` together, pass in the parent signals to the `AbortController` constructor.\n\n## Examples\n\nThe below examples assume that `doAsyncWork` is a function that takes a bag of properties, one of which is\nof the abort signal.\n\n### Example 1 - basic usage\n\n```js\nimport { AbortController } from \"@azure/abort-controller\";\n\nconst controller = new AbortController();\ndoAsyncWork({ abortSignal: controller.signal });\n\n// at some point later\ncontroller.abort();\n```\n\n### Example 2 - Aborting with timeout\n\n```js\nimport { AbortController } from \"@azure/abort-controller\";\n\nconst signal = AbortController.timeout(1000);\ndoAsyncWork({ abortSignal: signal });\n```\n\n### Example 3 - Aborting sub-tasks\n\n```js\nimport { AbortController } from \"@azure/abort-controller\";\n\nconst allTasksController = new AbortController();\n\nconst subTask1 = new AbortController(allTasksController.signal);\nconst subtask2 = new AbortController(allTasksController.signal);\n\nallTasksController.abort(); // aborts allTasksSignal, subTask1, subTask2\nsubTask1.abort(); // aborts only subTask1\n```\n\n### Example 4 - Aborting with parent signal or timeout\n\n```js\nimport { AbortController } from \"@azure/abort-controller\";\n\nconst allTasksController = new AbortController();\n\n// create a subtask controller that can be aborted manually,\n// or when either the parent task aborts or the timeout is reached.\nconst subTask = new AbortController(allTasksController.signal, AbortController.timeout(100));\n\nallTasksController.abort(); // aborts allTasksSignal, subTask\nsubTask.abort(); // aborts only subTask\n```\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor\nLicense Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your\ncontribution. For details, visit https://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and\ndecorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot.\nYou will only need to do this once across all repos using our CLA.\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/tree/16fdb6e2d6e9ec1490dd4539ca994f5c72981bd3/CONTRIBUTING.md) to learn more about how to build and test the code.\n\nThis project has adopted the Microsoft Open Source Code of Conduct.\nFor more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional\nquestions or comments.\n\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcore%2Fabort-controller%2FREADME.png)\n","scripts":{"lint":"eslint -c ../../.eslintrc.json src test --ext .ts -f html -o abort-controller-lintReport.html || exit 0","pack":"npm pack 2>&1","test":"npm run build:test && npm run unit-test && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"npm run build:es6 && npm run build:nodebrowser","clean":"rimraf dist dist-esm dist-test types temp dist-browser/*.js* dist-browser/*.zip statistics.html coverage coverage-browser .nyc_output *.tgz *.log test*.xml TEST*.xml","format":"prettier --write --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","pretest":"npm run build:test","lint:fix":"eslint \"src/**/*.ts\" \"test/**/*.ts\" -c ../../.eslintrc.json --fix --fix-type [problem,suggestion]","prebuild":"npm run clean","build:es6":"tsc -p tsconfig.json","test:node":"npm run build:test && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:test":"rollup -c rollup.test.config.js 2>&1","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run build:test && npm run unit-test:browser && npm run integration-test:browser","unit-test:node":"cross-env TS_NODE_FILES=true TS_NODE_COMPILER_OPTIONS=\"{\\\"module\\\": \\\"commonjs\\\"}\" mocha --require ts-node/register --require source-map-support/register --reporter mocha-multi --reporter-options spec=-,mocha-junit-reporter=- --full-trace --no-timeouts test/*.spec.ts","execute:samples":"echo skipped","integration-test":"npm run integration-test:node && npm run integration-test:browser","build:nodebrowser":"rollup -c 2>&1","unit-test:browser":"karma start --single-run","integration-test:node":"echo skipped","integration-test:browser":"echo skipped"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"sdk-type":"client","_resolved":"","_integrity":"","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.13.7","description":"Microsoft Azure SDK for JavaScript - Aborter","directories":{},"sideEffects":false,"_nodeVersion":"12.14.1","dependencies":{"tslib":"^1.10.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","delay":"^4.2.0","karma":"^4.0.1","mocha":"^6.2.2","assert":"^1.4.1","eslint":"^6.1.0","rimraf":"^3.0.0","rollup":"^1.16.3","ts-node":"^8.3.0","prettier":"^1.16.4","cross-env":"^6.0.3","typescript":"~3.7.5","@types/node":"^8.0.0","karma-mocha":"^1.3.0","mocha-multi":"^1.1.3","@types/mocha":"^5.2.5","karma-coverage":"^2.0.0","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","karma-remap-coverage":"^0.1.5","mocha-junit-reporter":"^1.18.0","rollup-plugin-terser":"^5.1.1","eslint-plugin-no-null":"^1.0.2","eslint-plugin-promise":"^4.1.1","karma-chrome-launcher":"^3.0.0","@rollup/plugin-replace":"^2.2.0","eslint-config-prettier":"^6.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","@rollup/plugin-commonjs":"^11.0.1","@microsoft/api-extractor":"^7.5.4","rollup-plugin-sourcemaps":"^0.4.2","@typescript-eslint/parser":"^2.0.0","@rollup/plugin-multi-entry":"^3.0.0","@rollup/plugin-node-resolve":"^7.0.0","eslint-plugin-no-only-tests":"^2.3.0","@typescript-eslint/eslint-plugin":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/abort-controller_1.0.1-dev.20200213.1_1581603283531_0.11800223483750161","host":"s3://npm-registry-packages"},"publish_time":1581603283671,"_cnpm_publish_time":1581603283671,"dist-tags":{"dev":"2.1.3-alpha.20260306.4","latest":"2.2.0"}}