{"name":"@azure/abort-controller","sdk-type":"client","version":"2.2.0","description":"Microsoft Azure SDK for JavaScript - Aborter","author":{"name":"Microsoft Corporation"},"license":"MIT","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/abort-controller/README.md","repository":{"type":"git","url":"git+https://github.com/Azure/azure-sdk-for-js.git","directory":"sdk/core/abort-controller"},"sideEffects":false,"type":"module","main":"./dist/commonjs/index.js","browser":"./dist/browser/index.js","react-native":"./dist/react-native/index.js","exports":{"./package.json":"./package.json",".":{"browser":{"types":"./dist/browser/index.d.ts","default":"./dist/browser/index.js"},"react-native":{"types":"./dist/react-native/index.d.ts","default":"./dist/react-native/index.js"},"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}}},"types":"./dist/commonjs/index.d.ts","engines":{"node":">=22.0.0"},"keywords":["azure","aborter","abortsignal","cancellation","node.js","typescript","javascript","browser","cloud"],"dependencies":{"tslib":"^2.6.2"},"devDependencies":{"@types/node":"^22.0.0","@types/react":"^19.2.14","@vitest/browser-playwright":"^4.1.2","@vitest/coverage-istanbul":"^4.1.2","cross-env":"^10.1.0","eslint":"^9.39.1","playwright":"^1.60.0","prettier":"^3.9.1","react-native":"^0.84.1","rimraf":"^6.1.0","typescript":"~6.0.2","vitest":"^4.1.2","@azure/dev-tool":"^1.0.0","@azure/eslint-plugin-azure-sdk":"^3.0.0"},"//metadata":{"migrationDate":"2023-03-08T18:36:03.000Z"},"module":"./dist/esm/index.js","imports":{"#platform/*":{"default":"./src/*.ts"}},"scripts":{"build":"npm run clean && dev-tool run build-package && dev-tool run extract-api","build:samples":"echo Skipped.","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,mjs,cjs,json}\"","clean":"rimraf --glob dist dist-* temp types *.tgz *.log","execute:samples":"echo skipped","extract-api":"dev-tool run build-package && dev-tool run extract-api","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,mjs,cjs,json}\"","lint":"eslint package.json src test","lint:fix":"eslint package.json src test --fix --fix-type [problem,suggestion]","pack":"pnpm pack 2>&1","test":"tsc -b --noEmit && npm run test:node && npm run test:browser","test:browser":"dev-tool run test:vitest --no-test-proxy --browser","test:node":"dev-tool run test:vitest --no-test-proxy","update-snippets":"dev-tool run update-snippets"},"_id":"@azure/abort-controller@2.2.0","_integrity":"sha512-fNAjWnA/nZ2jz31kxR/AqRaUT8ewHBw/WuBIosK0moMy1C9e5ValbDfFdIxJzVOOYaYkV/b2F1S4H/aHiqfVQg==","_resolved":"M:\\SvcFab\\_App\\MS.Ess.PackageManager.Publisher_App1\\temp\\03bc7d28-2f8e-4a7c-a863-7c73890733a3\\azure-abort-controller-2.2.0.tgz","_from":"file:M:\\SvcFab\\_App\\MS.Ess.PackageManager.Publisher_App1\\temp\\03bc7d28-2f8e-4a7c-a863-7c73890733a3\\azure-abort-controller-2.2.0.tgz","tag":"latest","_nodeVersion":"18.5.0","dist":{"integrity":"sha512-fNAjWnA/nZ2jz31kxR/AqRaUT8ewHBw/WuBIosK0moMy1C9e5ValbDfFdIxJzVOOYaYkV/b2F1S4H/aHiqfVQg==","shasum":"93e0e82b01862e7ea3b5b69958719d3f3fd2c8ac","tarball":"http://registry-npm.ywwl.com/@azure/abort-controller/download/@azure/abort-controller-2.2.0.tgz","fileCount":44,"unpackedSize":32364,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIF5A5r2a/R6O+9Nu9AKTh4lpehSJLvpc503ZDjuget4YAiEAqgad126hQv3tMY6CLpfOM7r2nb0pg6nfuPXrSwexA5s="}],"size":6263,"noattachment":false,"key":"/@azure/abort-controller/-/@azure/abort-controller-2.2.0.tgz"},"_npmUser":{"name":"microsoft1es","email":"npmjs@microsoft.com"},"directories":{},"maintainers":[{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},{"name":"microsoft1es","email":"npmjs@microsoft.com"},{"name":"microsoft-oss-releases","email":"microsoft-oss-publishing@microsoft.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/abort-controller_2.2.0_1783969860499_0.3098346890422268"},"_hasShrinkwrap":false,"readme":"# Azure Abort Controller client library for JavaScript\n\nThe `@azure/abort-controller` package provides `AbortSignalLike` interface and\n`AbortError` classes to make it easier to work with the\n[AbortController](https://developer.mozilla.org/docs/Web/API/AbortController)\nand the `AbortSignal` used by\n[fetch](https://developer.mozilla.org/docs/Web/API/Fetch_API) built into modern JavaScript platforms.\n\nCustomers of Azure SDK for JavaScript in general do not need to use this library. Instead they\nuse `AbortController` and `AbortSignal` provided by their platforms and pass the abort signals to Azure SDK operations.\n\nKey links:\n\n- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/abort-controller)\n- [Package (npm)](https://www.npmjs.com/package/@azure/abort-controller)\n- [API Reference Documentation](https://learn.microsoft.com/javascript/api/overview/azure/abort-controller-readme)\n\n## Getting started\n\n### Installation\n\nInstall this library using npm as follows\n\n```\nnpm install @azure/abort-controller\n```\n\n## Key Concepts\n\nUse `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. `AbortSignal.timeout(100)`.\nthat is cancelled after 100 milliseconds.\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```ts snippet:ReadmeSampleBasicUsage\nasync function doAsyncWork(options: { abortSignal: AbortSignal }): Promise<void> {\n  if (options.abortSignal.aborted) {\n    return;\n  }\n\n  // do async work\n}\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```ts snippet:ReadmeSampleBasicTimeout\nasync function doAsyncWork(options: { abortSignal: AbortSignal }): Promise<void> {\n  if (options.abortSignal.aborted) {\n    return;\n  }\n\n  // do async work\n}\n\nconst signal = AbortSignal.timeout(1000);\ndoAsyncWork({ abortSignal: signal });\n```\n\n## Next steps\n\nYou can build and run the tests locally by executing `npm run test`. Explore the `test` folder to see advanced usage and behavior of the public classes.\n\n## Troubleshooting\n\nIf you run into issues while using this library, please feel free to [file an issue](https://github.com/Azure/azure-sdk-for-js/issues/new).\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.\n","publish_time":1783969860668,"_cnpm_publish_time":1783969860668,"dist-tags":{"dev":"2.1.3-alpha.20260306.4","latest":"2.2.0"}}