{"_id":"p-cancelable","_rev":"199022","name":"p-cancelable","description":"Create a promise that can be canceled","dist-tags":{"latest":"4.0.1"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2023-03-20T08:15:00.000Z","created":"2016-11-28T10:56:08.946Z","4.0.1":"2022-07-19T14:03:33.922Z","4.0.0":"2022-04-24T15:04:24.293Z","3.0.0":"2021-05-31T13:28:23.690Z","2.1.1":"2021-05-02T10:21:12.564Z","2.1.0":"2021-03-10T06:57:15.048Z","2.0.0":"2019-03-31T20:02:00.172Z","1.1.0":"2019-03-08T08:43:07.840Z","1.0.0":"2018-10-22T07:29:51.952Z","0.5.1":"2018-09-10T16:32:13.688Z","0.5.0":"2018-07-04T06:21:35.707Z","0.4.1":"2018-04-01T11:22:59.190Z","0.4.0":"2018-03-06T15:01:51.923Z","0.3.0":"2017-06-30T15:48:55.134Z","0.2.0":"2017-05-05T05:39:17.492Z","0.1.0":"2016-11-28T10:56:08.946Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-cancelable.git"},"versions":{"4.0.1":{"name":"p-cancelable","version":"4.0.1","description":"Create a promise that can be canceled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-cancelable.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=14.16"},"scripts":{"test":"xo && ava && tsd"},"keywords":["promise","cancelable","cancel","canceled","canceling","cancellable","cancellation","abort","abortable","aborting","cleanup","task","token","async","function","await","promises","bluebird"],"devDependencies":{"ava":"^4.2.0","delay":"^5.0.0","tsd":"^0.20.0","xo":"^0.48.0"},"types":"./index.d.ts","gitHead":"5db52128b57b5d1e11b4df860b5d4257475d4071","bugs":{"url":"https://github.com/sindresorhus/p-cancelable/issues"},"homepage":"https://github.com/sindresorhus/p-cancelable#readme","_id":"p-cancelable@4.0.1","_nodeVersion":"16.15.0","_npmVersion":"8.3.2","dist":{"shasum":"2d1edf1ab8616b72c73db41c4bc9ecdd10af640e","size":4458,"noattachment":false,"key":"/p-cancelable/-/p-cancelable-4.0.1.tgz","tarball":"http://name.csiicloud.com:7001/p-cancelable/download/p-cancelable-4.0.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-cancelable_4.0.1_1658239413718_0.37320410047508945"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-07-19T14:31:25.026Z","publish_time":1658239413922,"_cnpm_publish_time":1658239413922},"4.0.0":{"name":"p-cancelable","version":"4.0.0","description":"Create a promise that can be canceled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-cancelable.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=14.16"},"scripts":{"test":"xo && ava && tsd"},"keywords":["promise","cancelable","cancel","canceled","canceling","cancellable","cancellation","abort","abortable","aborting","cleanup","task","token","async","function","await","promises","bluebird"],"devDependencies":{"ava":"^4.2.0","delay":"^5.0.0","tsd":"^0.20.0","xo":"^0.48.0"},"types":"./index.d.ts","gitHead":"f1adca0772aacc5626a82e2c5bce20536248bf23","bugs":{"url":"https://github.com/sindresorhus/p-cancelable/issues"},"homepage":"https://github.com/sindresorhus/p-cancelable#readme","_id":"p-cancelable@4.0.0","_nodeVersion":"14.19.1","_npmVersion":"8.3.2","dist":{"shasum":"2bf05af7052dbf1c64d5f763a8cedc54b5095b9c","size":4433,"noattachment":false,"key":"/p-cancelable/-/p-cancelable-4.0.0.tgz","tarball":"http://name.csiicloud.com:7001/p-cancelable/download/p-cancelable-4.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-cancelable_4.0.0_1650812664110_0.33194743760523004"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-04-24T15:04:27.178Z","publish_time":1650812664293,"_cnpm_publish_time":1650812664293},"3.0.0":{"name":"p-cancelable","version":"3.0.0","description":"Create a promise that can be canceled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-cancelable.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12.20"},"scripts":{"test":"xo && ava && tsd"},"keywords":["promise","cancelable","cancel","canceled","canceling","cancellable","cancellation","abort","abortable","aborting","cleanup","task","token","async","function","await","promises","bluebird"],"devDependencies":{"ava":"^3.15.0","delay":"^5.0.0","tsd":"^0.16.0","xo":"^0.40.1"},"gitHead":"30edb363b20c380067364a9f4ebc43e3129c07d9","bugs":{"url":"https://github.com/sindresorhus/p-cancelable/issues"},"homepage":"https://github.com/sindresorhus/p-cancelable#readme","_id":"p-cancelable@3.0.0","_nodeVersion":"12.22.1","_npmVersion":"7.10.0","dist":{"shasum":"63826694b54d61ca1c20ebcb6d3ecf5e14cd8050","size":4361,"noattachment":false,"key":"/p-cancelable/-/p-cancelable-3.0.0.tgz","tarball":"http://name.csiicloud.com:7001/p-cancelable/download/p-cancelable-3.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-cancelable_3.0.0_1622467703540_0.5798264943193931"},"_hasShrinkwrap":false,"publish_time":1622467703690,"_cnpm_publish_time":1622467703690},"2.1.1":{"name":"p-cancelable","version":"2.1.1","description":"Create a promise that can be canceled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-cancelable.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["promise","cancelable","cancel","canceled","canceling","cancellable","cancellation","abort","abortable","aborting","cleanup","task","token","async","function","await","promises","bluebird"],"devDependencies":{"ava":"^1.4.1","delay":"^4.1.0","promise.prototype.finally":"^3.1.0","tsd":"^0.7.1","xo":"^0.24.0"},"gitHead":"ab7fb34ab7569eb5822548ac6766e2469a48b98d","bugs":{"url":"https://github.com/sindresorhus/p-cancelable/issues"},"homepage":"https://github.com/sindresorhus/p-cancelable#readme","_id":"p-cancelable@2.1.1","_nodeVersion":"16.0.0","_npmVersion":"7.10.0","dist":{"shasum":"aab7fbd416582fa32a3db49859c122487c5ed2cf","size":4426,"noattachment":false,"key":"/p-cancelable/-/p-cancelable-2.1.1.tgz","tarball":"http://name.csiicloud.com:7001/p-cancelable/download/p-cancelable-2.1.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-cancelable_2.1.1_1619950872444_0.7737593099583226"},"_hasShrinkwrap":false,"publish_time":1619950872564,"_cnpm_publish_time":1619950872564},"2.1.0":{"name":"p-cancelable","version":"2.1.0","description":"Create a promise that can be canceled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-cancelable.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["promise","cancelable","cancel","canceled","canceling","cancellable","cancellation","abort","abortable","aborting","cleanup","task","token","async","function","await","promises","bluebird"],"devDependencies":{"ava":"^1.4.1","delay":"^4.1.0","promise.prototype.finally":"^3.1.0","tsd":"^0.7.1","xo":"^0.24.0"},"gitHead":"78639762f7c3ea26efb182ad0b65c4a8eacb5822","bugs":{"url":"https://github.com/sindresorhus/p-cancelable/issues"},"homepage":"https://github.com/sindresorhus/p-cancelable#readme","_id":"p-cancelable@2.1.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"4d51c3b91f483d02a0d300765321fca393d758dd","size":4450,"noattachment":false,"key":"/p-cancelable/-/p-cancelable-2.1.0.tgz","tarball":"http://name.csiicloud.com:7001/p-cancelable/download/p-cancelable-2.1.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-cancelable_2.1.0_1615359434883_0.2511422226617046"},"_hasShrinkwrap":false,"publish_time":1615359435048,"_cnpm_publish_time":1615359435048},"2.0.0":{"name":"p-cancelable","version":"2.0.0","description":"Create a promise that can be canceled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-cancelable.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["promise","cancelable","cancel","canceled","canceling","cancellable","cancellation","abort","abortable","aborting","cleanup","task","token","async","function","await","promises","bluebird"],"devDependencies":{"ava":"^1.4.1","delay":"^4.1.0","promise.prototype.finally":"^3.1.0","tsd":"^0.7.1","xo":"^0.24.0"},"gitHead":"5bcb7bcf966fc416755b50c24c4d7eb2fbf44b0e","bugs":{"url":"https://github.com/sindresorhus/p-cancelable/issues"},"homepage":"https://github.com/sindresorhus/p-cancelable#readme","_id":"p-cancelable@2.0.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"4a3740f5bdaf5ed5d7c3e34882c6fb5d6b266a6e","size":4119,"noattachment":false,"key":"/p-cancelable/-/p-cancelable-2.0.0.tgz","tarball":"http://name.csiicloud.com:7001/p-cancelable/download/p-cancelable-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-cancelable_2.0.0_1554062519912_0.7909646907529038"},"_hasShrinkwrap":false,"publish_time":1554062520172,"_cnpm_publish_time":1554062520172},"1.1.0":{"name":"p-cancelable","version":"1.1.0","description":"Create a promise that can be canceled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-cancelable.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava && tsd-check"},"keywords":["promise","cancelable","cancel","canceled","canceling","cancellable","cancellation","abort","abortable","aborting","cleanup","task","token","async","function","await","promises","bluebird"],"devDependencies":{"ava":"^1.3.1","delay":"^4.1.0","promise.prototype.finally":"^3.1.0","tsd-check":"^0.3.0","xo":"^0.24.0"},"gitHead":"8746e2a93a925e4e28a7848b6e08cad799f33ddd","bugs":{"url":"https://github.com/sindresorhus/p-cancelable/issues"},"homepage":"https://github.com/sindresorhus/p-cancelable#readme","_id":"p-cancelable@1.1.0","_nodeVersion":"8.15.0","_npmVersion":"6.8.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"d078d15a3af409220c886f1d9a0ca2e441ab26cc","size":4025,"noattachment":false,"key":"/p-cancelable/-/p-cancelable-1.1.0.tgz","tarball":"http://name.csiicloud.com:7001/p-cancelable/download/p-cancelable-1.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-cancelable_1.1.0_1552034587600_0.8347780998024625"},"_hasShrinkwrap":false,"publish_time":1552034587840,"_cnpm_publish_time":1552034587840},"1.0.0":{"name":"p-cancelable","version":"1.0.0","description":"Create a promise that can be canceled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-cancelable.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava"},"keywords":["promise","cancelable","cancel","canceled","canceling","cancellable","cancellation","abort","abortable","aborting","cleanup","task","token","async","function","await","promises","bluebird"],"devDependencies":{"ava":"^0.25.0","delay":"^4.1.0","promise.prototype.finally":"^3.1.0","xo":"^0.23.0"},"gitHead":"354c4000c3b7602faa601e7e060a05d581b89419","bugs":{"url":"https://github.com/sindresorhus/p-cancelable/issues"},"homepage":"https://github.com/sindresorhus/p-cancelable#readme","_id":"p-cancelable@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"07e9c6d22c31f9c6784cb4f1e1454a79b6d9e2d6","size":3317,"noattachment":false,"key":"/p-cancelable/-/p-cancelable-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/p-cancelable/download/p-cancelable-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-cancelable_1.0.0_1540193391787_0.31877812620970536"},"_hasShrinkwrap":false,"publish_time":1540193391952,"_cnpm_publish_time":1540193391952},"0.5.1":{"name":"p-cancelable","version":"0.5.1","description":"Create a promise that can be canceled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-cancelable.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava"},"keywords":["promise","cancelable","cancel","canceled","canceling","cancellable","cancellation","abort","abortable","aborting","cleanup","task","token","async","function","await","promises","bluebird"],"devDependencies":{"ava":"*","delay":"^3.0.0","promise.prototype.finally":"^3.1.0","xo":"^0.23.0"},"gitHead":"b7e75aa16c846286e7426b31d659dd1a6da09fb5","bugs":{"url":"https://github.com/sindresorhus/p-cancelable/issues"},"homepage":"https://github.com/sindresorhus/p-cancelable#readme","_id":"p-cancelable@0.5.1","_npmVersion":"5.6.0","_nodeVersion":"8.11.4","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"b797a33c43c645cd70d5a838b1d25352b9e29e75","size":3340,"noattachment":false,"key":"/p-cancelable/-/p-cancelable-0.5.1.tgz","tarball":"http://name.csiicloud.com:7001/p-cancelable/download/p-cancelable-0.5.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-cancelable_0.5.1_1536597133529_0.9791231164444081"},"_hasShrinkwrap":false,"publish_time":1536597133688,"_cnpm_publish_time":1536597133688},"0.5.0":{"name":"p-cancelable","version":"0.5.0","description":"Create a promise that can be canceled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-cancelable.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["promise","cancelable","cancel","canceled","canceling","cancellable","cancellation","abort","abortable","aborting","cleanup","task","token","async","function","await","promises","bluebird"],"devDependencies":{"ava":"*","delay":"^3.0.0","promise.prototype.finally":"^3.1.0","xo":"*"},"gitHead":"54b12bba45d3b38180f7a490bc2bc24e384612ac","bugs":{"url":"https://github.com/sindresorhus/p-cancelable/issues"},"homepage":"https://github.com/sindresorhus/p-cancelable#readme","_id":"p-cancelable@0.5.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"65b8dfbcacf27983421ee4c044ebf5e35816c7c8","size":3166,"noattachment":false,"key":"/p-cancelable/-/p-cancelable-0.5.0.tgz","tarball":"http://name.csiicloud.com:7001/p-cancelable/download/p-cancelable-0.5.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-cancelable_0.5.0_1530685295652_0.4673471413509742"},"_hasShrinkwrap":false,"publish_time":1530685295707,"_cnpm_publish_time":1530685295707},"0.4.1":{"name":"p-cancelable","version":"0.4.1","description":"Create a promise that can be canceled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-cancelable.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["promise","cancelable","cancel","canceled","canceling","cancellable","cancellation","abort","abortable","aborting","cleanup","task","token","async","function","await","promises","bluebird"],"devDependencies":{"ava":"*","delay":"^2.0.0","promise.prototype.finally":"^3.1.0","xo":"*"},"gitHead":"50d66ce7228c23511a754a03d52aebf55e0229b1","bugs":{"url":"https://github.com/sindresorhus/p-cancelable/issues"},"homepage":"https://github.com/sindresorhus/p-cancelable#readme","_id":"p-cancelable@0.4.1","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"35f363d67d52081c8d9585e37bcceb7e0bbcb2a0","size":3155,"noattachment":false,"key":"/p-cancelable/-/p-cancelable-0.4.1.tgz","tarball":"http://name.csiicloud.com:7001/p-cancelable/download/p-cancelable-0.4.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-cancelable_0.4.1_1522581779099_0.05425666370241489"},"_hasShrinkwrap":false,"publish_time":1522581779190,"_cnpm_publish_time":1522581779190},"0.4.0":{"name":"p-cancelable","version":"0.4.0","description":"Create a promise that can be canceled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-cancelable.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["promise","cancelable","cancel","canceled","canceling","cancellable","cancellation","abort","abortable","aborting","cleanup","task","token","async","function","await","promises","bluebird"],"devDependencies":{"ava":"*","delay":"^2.0.0","xo":"*"},"gitHead":"172141757dff0acaf3d6a93473c1ba3c2e78a7aa","bugs":{"url":"https://github.com/sindresorhus/p-cancelable/issues"},"homepage":"https://github.com/sindresorhus/p-cancelable#readme","_id":"p-cancelable@0.4.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"bcb41d35bf6097fc4367a065b6eb84b9b124eff0","size":3111,"noattachment":false,"key":"/p-cancelable/-/p-cancelable-0.4.0.tgz","tarball":"http://name.csiicloud.com:7001/p-cancelable/download/p-cancelable-0.4.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-cancelable_0.4.0_1520348511879_0.719711445299539"},"_hasShrinkwrap":false,"publish_time":1520348511923,"_cnpm_publish_time":1520348511923},"0.3.0":{"name":"p-cancelable","version":"0.3.0","description":"Create a promise that can be canceled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-cancelable.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["promise","cancelable","cancel","canceled","canceling","cancellable","cancellation","abort","abortable","aborting","cleanup","task","token","async","function","await","promises","bluebird"],"devDependencies":{"ava":"*","delay":"^2.0.0","xo":"*"},"gitHead":"0ea492a3a02e5b8bb984b7a7f1db60a31f66da0b","bugs":{"url":"https://github.com/sindresorhus/p-cancelable/issues"},"homepage":"https://github.com/sindresorhus/p-cancelable#readme","_id":"p-cancelable@0.3.0","_npmVersion":"5.0.0","_nodeVersion":"8.0.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"b9e123800bcebb7ac13a479be195b507b98d30fa","size":3033,"noattachment":false,"key":"/p-cancelable/-/p-cancelable-0.3.0.tgz","tarball":"http://name.csiicloud.com:7001/p-cancelable/download/p-cancelable-0.3.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/p-cancelable-0.3.0.tgz_1498837734166_0.038153667002916336"},"directories":{},"publish_time":1498837735134,"_hasShrinkwrap":false,"_cnpm_publish_time":1498837735134},"0.2.0":{"name":"p-cancelable","version":"0.2.0","description":"Create a promise that can be canceled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-cancelable.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["promise","cancelable","cancel","canceled","canceling","cancellable","cancellation","abort","abortable","aborting","cleanup","task","token","async","function","await","promises","bluebird"],"devDependencies":{"ava":"*","delay":"^2.0.0","xo":"*"},"gitHead":"3da2d57d79c0ba9c68db62822cae124dcc5a0d9f","bugs":{"url":"https://github.com/sindresorhus/p-cancelable/issues"},"homepage":"https://github.com/sindresorhus/p-cancelable#readme","_id":"p-cancelable@0.2.0","_shasum":"3152f4f30be7606b60ebfe8bb93b3fdf69085e46","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"3152f4f30be7606b60ebfe8bb93b3fdf69085e46","size":3017,"noattachment":false,"key":"/p-cancelable/-/p-cancelable-0.2.0.tgz","tarball":"http://name.csiicloud.com:7001/p-cancelable/download/p-cancelable-0.2.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/p-cancelable-0.2.0.tgz_1493962754416_0.057322570122778416"},"directories":{},"publish_time":1493962757492,"_hasShrinkwrap":false,"_cnpm_publish_time":1493962757492},"0.1.0":{"name":"p-cancelable","version":"0.1.0","description":"Create a promise that can be canceled","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/p-cancelable.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["promise","cancelable","cancel","canceled","canceling","cancellable","cancellation","abort","abortable","aborting","cleanup","task","token","async","function","await","promises","bluebird"],"devDependencies":{"ava":"*","delay":"^1.3.1","xo":"*"},"xo":{"esnext":true},"gitHead":"5e1f5b4d5b8b0f7549c87dbae0417c4afe9c6d8f","bugs":{"url":"https://github.com/sindresorhus/p-cancelable/issues"},"homepage":"https://github.com/sindresorhus/p-cancelable#readme","_id":"p-cancelable@0.1.0","_shasum":"7a551d2b87cd825e927683ab996b13abdbd53ed2","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.6.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"7a551d2b87cd825e927683ab996b13abdbd53ed2","size":2997,"noattachment":false,"key":"/p-cancelable/-/p-cancelable-0.1.0.tgz","tarball":"http://name.csiicloud.com:7001/p-cancelable/download/p-cancelable-0.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/p-cancelable-0.1.0.tgz_1480330568731_0.36330019892193377"},"directories":{},"publish_time":1480330568946,"_cnpm_publish_time":1480330568946,"_hasShrinkwrap":false}},"readme":"# p-cancelable\n\n> Create a promise that can be canceled\n\nUseful for animation, loading resources, long-running async computations, async iteration, etc.\n\n*If you target [Node.js 16](https://medium.com/@nodejs/node-js-v15-0-0-is-here-deb00750f278) or later, this package is [less useful](https://github.com/sindresorhus/p-cancelable/issues/27) and you should probably use [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) instead.*\n\n## Install\n\n```sh\nnpm install p-cancelable\n```\n\n## Usage\n\n```js\nimport PCancelable from 'p-cancelable';\n\nconst cancelablePromise = new PCancelable((resolve, reject, onCancel) => {\n\tconst worker = new SomeLongRunningOperation();\n\n\tonCancel(() => {\n\t\tworker.close();\n\t});\n\n\tworker.on('finish', resolve);\n\tworker.on('error', reject);\n});\n\n// Cancel the operation after 10 seconds\nsetTimeout(() => {\n\tcancelablePromise.cancel('Unicorn has changed its color');\n}, 10000);\n\ntry {\n\tconsole.log('Operation finished successfully:', await cancelablePromise);\n} catch (error) {\n\tif (cancelablePromise.isCanceled) {\n\t\t// Handle the cancelation here\n\t\tconsole.log('Operation was canceled');\n\t\treturn;\n\t}\n\n\tthrow error;\n}\n```\n\n## API\n\n### new PCancelable(executor)\n\nSame as the [`Promise` constructor](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise), but with an appended `onCancel` parameter in `executor`.\n\nCancelling will reject the promise with `CancelError`. To avoid that, set `onCancel.shouldReject` to `false`.\n\n```js\nimport PCancelable from 'p-cancelable';\n\nconst cancelablePromise = new PCancelable((resolve, reject, onCancel) => {\n\tconst job = new Job();\n\n\tonCancel.shouldReject = false;\n\tonCancel(() => {\n\t\tjob.stop();\n\t});\n\n\tjob.on('finish', resolve);\n});\n\ncancelablePromise.cancel(); // Doesn't throw an error\n```\n\n`PCancelable` is a subclass of `Promise`.\n\n#### onCanceled(fn)\n\nType: `Function`\n\nAccepts a function that is called when the promise is canceled.\n\nYou're not required to call this function. You can call this function multiple times to add multiple cancel handlers.\n\n### PCancelable#cancel(reason?)\n\nType: `Function`\n\nCancel the promise and optionally provide a reason.\n\nThe cancellation is synchronous. Calling it after the promise has settled or multiple times does nothing.\n\n### PCancelable#isCanceled\n\nType: `boolean`\n\nWhether the promise is canceled.\n\n### PCancelable.fn(fn)\n\nConvenience method to make your promise-returning or async function cancelable.\n\nThe function you specify will have `onCancel` appended to its parameters.\n\n```js\nimport PCancelable from 'p-cancelable';\n\nconst fn = PCancelable.fn((input, onCancel) => {\n\tconst job = new Job();\n\n\tonCancel(() => {\n\t\tjob.cleanup();\n\t});\n\n\treturn job.start(); //=> Promise\n});\n\nconst cancelablePromise = fn('input'); //=> PCancelable\n\n// …\n\ncancelablePromise.cancel();\n```\n\n### CancelError\n\nType: `Error`\n\nRejection reason when `.cancel()` is called.\n\nIt includes a `.isCanceled` property for convenience.\n\n## FAQ\n\n### Cancelable vs. Cancellable\n\n[In American English, the verb cancel is usually inflected canceled and canceling—with one l.](http://grammarist.com/spelling/cancel/) Both a [browser API](https://developer.mozilla.org/en-US/docs/Web/API/Event/cancelable) and the [Cancelable Promises proposal](https://github.com/tc39/proposal-cancelable-promises) use this spelling.\n\n### What about the official [Cancelable Promises proposal](https://github.com/tc39/proposal-cancelable-promises)?\n\n~~It's still an early draft and I don't really like its current direction. It complicates everything and will require deep changes in the ecosystem to adapt to it. And the way you have to use cancel tokens is verbose and convoluted. I much prefer the more pragmatic and less invasive approach in this module.~~ The proposal was withdrawn.\n\n## p-cancelable for enterprise\n\nAvailable as part of the Tidelift Subscription.\n\nThe maintainers of p-cancelable and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-p-cancelable?utm_source=npm-p-cancelable&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)\n\n## Related\n\n- [p-progress](https://github.com/sindresorhus/p-progress) - Create a promise that reports progress\n- [p-lazy](https://github.com/sindresorhus/p-lazy) - Create a lazy promise that defers execution until `.then()` or `.catch()` is called\n- [More…](https://github.com/sindresorhus/promise-fun)\n","_attachments":{},"homepage":"https://github.com/sindresorhus/p-cancelable#readme","bugs":{"url":"https://github.com/sindresorhus/p-cancelable/issues"},"license":"MIT"}