{"_id":"async-settle","_rev":"3343402","name":"async-settle","description":"Settle an async function.","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"phated","email":"blaine.bublitz@gmail.com"},{"name":"yocontra","email":""}],"time":{"modified":"2024-07-10T08:45:12.000Z","created":"2014-03-10T07:19:11.567Z","2.0.0":"2022-06-25T00:38:34.020Z","1.0.0":"2016-06-26T21:04:59.171Z","0.2.1":"2014-08-23T04:37:11.440Z","0.2.0":"2014-08-23T04:34:50.205Z","0.1.0":"2014-03-10T07:19:41.438Z","0.0.0":"2014-03-10T07:19:11.567Z"},"users":{},"author":{"name":"Gulp Team","email":"team@gulpjs.com","url":"http://gulpjs.com/"},"repository":{"type":"git","url":"git+https://github.com/gulpjs/async-settle.git"},"versions":{"2.0.0":{"name":"async-settle","version":"2.0.0","description":"Settle an async function.","author":{"name":"Gulp Team","email":"team@gulpjs.com","url":"http://gulpjs.com/"},"contributors":[{"name":"Blaine Bublitz","email":"blaine.bublitz@gmail.com"}],"repository":{"type":"git","url":"git+https://github.com/gulpjs/async-settle.git"},"license":"MIT","engines":{"node":">= 10.13.0"},"main":"index.js","scripts":{"lint":"eslint . ","pretest":"npm run lint","test":"nyc mocha --async-only"},"dependencies":{"async-done":"^2.0.0"},"devDependencies":{"eslint":"^7.32.0","eslint-config-gulp":"^5.0.1","eslint-plugin-node":"^11.1.0","expect":"^27.4.2","mocha":"^8.4.0","nyc":"^15.1.0"},"nyc":{"reporter":["lcov","text-summary"]},"prettier":{"singleQuote":true},"keywords":["settle","async","async-done","complete","error","parallel"],"gitHead":"72b98659acbaea9ac1b5ab3b8105bac2625e2bf5","bugs":{"url":"https://github.com/gulpjs/async-settle/issues"},"homepage":"https://github.com/gulpjs/async-settle#readme","_id":"async-settle@2.0.0","_nodeVersion":"16.14.2","_npmVersion":"8.11.0","dist":{"shasum":"c695ad14e070f6a755d019d32d6eb38029020287","size":2491,"noattachment":false,"key":"/async-settle/-/async-settle-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-settle/download/async-settle-2.0.0.tgz"},"_npmUser":{"name":"phated","email":"blaine.bublitz@gmail.com"},"directories":{},"maintainers":[{"name":"phated","email":"blaine.bublitz@gmail.com"},{"name":"yocontra","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-settle_2.0.0_1656117513847_0.04545783789318891"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-06-25T00:38:38.277Z","publish_time":1656117514020,"_cnpm_publish_time":1656117514020},"1.0.0":{"name":"async-settle","version":"1.0.0","description":"Settle an async function.","author":{"name":"Gulp Team","email":"team@gulpjs.com","url":"http://gulpjs.com/"},"contributors":[{"name":"Blaine Bublitz","email":"blaine.bublitz@gmail.com"}],"repository":{"type":"git","url":"git+https://github.com/gulpjs/async-settle.git"},"license":"MIT","engines":{"node":">= 0.10"},"main":"index.js","files":["index.js","LICENSE"],"scripts":{"lint":"eslint . && jscs index.js test/","pretest":"npm run lint","test":"mocha --async-only","cover":"istanbul cover _mocha --report lcovonly","coveralls":"npm run cover && istanbul-coveralls"},"dependencies":{"async-done":"^1.2.2"},"devDependencies":{"eslint":"^1.7.3","eslint-config-gulp":"^2.0.0","expect":"^1.19.0","istanbul":"^0.4.3","istanbul-coveralls":"^1.0.3","jscs":"^2.3.5","jscs-preset-gulp":"^1.0.0","mocha":"^2.4.5"},"keywords":["settle","async","async-done","complete","error","parallel"],"gitHead":"96fc96809f72f179358279cc85318f73ad12db53","bugs":{"url":"https://github.com/gulpjs/async-settle/issues"},"homepage":"https://github.com/gulpjs/async-settle#readme","_id":"async-settle@1.0.0","_shasum":"1d0a914bb02575bec8a8f3a74e5080f72b2c0c6b","_from":".","_npmVersion":"2.15.2","_nodeVersion":"0.10.41","_npmUser":{"name":"phated","email":"blaine.bublitz@gmail.com"},"maintainers":[{"name":"phated","email":"blaine.bublitz@gmail.com"},{"name":"yocontra","email":""}],"dist":{"shasum":"1d0a914bb02575bec8a8f3a74e5080f72b2c0c6b","size":2552,"noattachment":false,"key":"/async-settle/-/async-settle-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-settle/download/async-settle-1.0.0.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/async-settle-1.0.0.tgz_1466975095176_0.044924013782292604"},"directories":{},"publish_time":1466975099171,"_cnpm_publish_time":1466975099171,"_hasShrinkwrap":false},"0.2.1":{"name":"async-settle","version":"0.2.1","description":"Settle your async functions - when you need to know all your parallel functions are complete (success or failure)","main":"index.js","directories":{"test":"test"},"scripts":{"test":"tap ./test"},"repository":{"type":"git","url":"git://github.com/phated/async-settle"},"keywords":["settle","async","async-done","complete","error","parallel"],"author":{"name":"Blaine Bublitz","email":"blaine@iceddev.com","url":"http://iceddev.com/"},"license":"MIT","bugs":{"url":"https://github.com/phated/async-settle/issues"},"homepage":"https://github.com/phated/async-settle","devDependencies":{"tap":"^0.4.8"},"dependencies":{"async-done":"^0.4.0"},"gitHead":"a1571d6caa3e883758cd4f083c9a1a93eedd6f22","_id":"async-settle@0.2.1","_shasum":"767462d5738008dc75eac4246223528f21371396","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"phated","email":"blaine@iceddev.com"},"maintainers":[{"name":"phated","email":"blaine.bublitz@gmail.com"},{"name":"yocontra","email":""}],"dist":{"shasum":"767462d5738008dc75eac4246223528f21371396","size":2167,"noattachment":false,"key":"/async-settle/-/async-settle-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-settle/download/async-settle-0.2.1.tgz"},"publish_time":1408768631440,"_cnpm_publish_time":1408768631440,"_hasShrinkwrap":false},"0.2.0":{"name":"async-settle","version":"0.2.0","description":"Settle your async functions - when you need to know all your parallel functions are complete (success or failure)","main":"index.js","directories":{"test":"test"},"scripts":{"test":"tap ./test"},"repository":{"type":"git","url":"git://github.com/phated/async-settle"},"keywords":["settle","async","async-done","complete","error","parallel"],"author":{"name":"Blaine Bublitz","email":"blaine@iceddev.com","url":"http://iceddev.com/"},"license":"MIT","bugs":{"url":"https://github.com/phated/async-settle/issues"},"homepage":"https://github.com/phated/async-settle","devDependencies":{"tap":"^0.4.8"},"dependencies":{"async-done":"^0.4.0"},"gitHead":"8cd515a6f02d02ac7e8bb712312782d6e233819e","_id":"async-settle@0.2.0","_shasum":"e291b78f4a0584d86c2a7e33d82c1ce669a259e8","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"phated","email":"blaine@iceddev.com"},"maintainers":[{"name":"phated","email":"blaine.bublitz@gmail.com"},{"name":"yocontra","email":""}],"dist":{"shasum":"e291b78f4a0584d86c2a7e33d82c1ce669a259e8","size":2167,"noattachment":false,"key":"/async-settle/-/async-settle-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-settle/download/async-settle-0.2.0.tgz"},"publish_time":1408768490205,"_cnpm_publish_time":1408768490205,"_hasShrinkwrap":false},"0.1.0":{"name":"async-settle","version":"0.1.0","description":"Settle your async functions - when you need to know all your parallel functions are complete (success or failure)","main":"index.js","directories":{"test":"test"},"scripts":{"test":"tap ./test"},"repository":{"type":"git","url":"git://github.com/phated/async-settle"},"keywords":["settle","async","async-done","complete","error","parallel"],"author":{"name":"Blaine Bublitz","email":"blaine@iceddev.com","url":"http://iceddev.com/"},"license":"MIT","bugs":{"url":"https://github.com/phated/async-settle/issues"},"homepage":"https://github.com/phated/async-settle","devDependencies":{"tap":"^0.4.8"},"dependencies":{"async-done":"^0.2.0"},"_id":"async-settle@0.1.0","dist":{"shasum":"94baf42904a3cfd7e845e03b3e61ad1fac893dcd","size":2166,"noattachment":false,"key":"/async-settle/-/async-settle-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-settle/download/async-settle-0.1.0.tgz"},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"phated","email":"blaine@iceddev.com"},"maintainers":[{"name":"phated","email":"blaine.bublitz@gmail.com"},{"name":"yocontra","email":""}],"publish_time":1394435981438,"_hasShrinkwrap":false,"_cnpm_publish_time":1394435981438},"0.0.0":{"name":"async-settle","version":"0.0.0","description":"Settle your async functions - when you need to know all your parallel functions are complete (success or failure)","main":"index.js","directories":{"test":"test"},"scripts":{"test":"tap ./test"},"repository":{"type":"git","url":"git://github.com/phated/async-settle"},"keywords":["settle","async","async-done","complete","error","parallel"],"author":{"name":"Blaine Bublitz","email":"blaine@iceddev.com","url":"http://iceddev.com/"},"license":"MIT","bugs":{"url":"https://github.com/phated/async-settle/issues"},"homepage":"https://github.com/phated/async-settle","devDependencies":{"tap":"^0.4.8"},"dependencies":{"async-done":"^0.2.0"},"_id":"async-settle@0.0.0","dist":{"shasum":"954c2d09d60ab6bc6f082e3cc7a7855c43dc1a83","size":2165,"noattachment":false,"key":"/async-settle/-/async-settle-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-settle/download/async-settle-0.0.0.tgz"},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"phated","email":"blaine@iceddev.com"},"maintainers":[{"name":"phated","email":"blaine.bublitz@gmail.com"},{"name":"yocontra","email":""}],"publish_time":1394435951567,"_hasShrinkwrap":false,"_cnpm_publish_time":1394435951567}},"readme":"<p align=\"center\">\n  <a href=\"https://gulpjs.com\">\n    <img height=\"257\" width=\"114\" src=\"https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png\">\n  </a>\n</p>\n\n# async-settle\n\n[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]\n\nSettle an async function. It will always complete successfully with an object of the resulting state.\n\nHandles completion and errors for callbacks, promises, observables and streams.\n\nWill run call the function on `nextTick`. This will cause all functions to be async.\n\n## Usage\n\n### Successful completion\n\n```js\nvar asyncSettle = require('async-settle');\n\nasyncSettle(\n  function (done) {\n    // do async things\n    done(null, 2);\n  },\n  function (error, result) {\n    // `error` will ALWAYS be null on execution of the first function.\n    // `result` will ALWAYS be a settled object with the result or error of the first function.\n  }\n);\n```\n\n### Failed completion\n\n```js\nvar asyncSettle = require('async-settle');\n\nasyncSettle(\n  function (done) {\n    // do async things\n    done(new Error('Some Error Occurred'));\n  },\n  function (error, result) {\n    // `error` will ALWAYS be null on execution of the first function.\n    // `result` will ALWAYS be a settled object with the result or error of the first function.\n  }\n);\n```\n\n## API\n\n### `asyncSettle(fn, callback)`\n\nTakes a function to execute (`fn`) and a function to call on completion (`callback`).\n\n#### `fn([done])`\n\nOptionally takes a callback (`done`) to call when async tasks are complete.\n\nExecuted in the context of [`async-done`][async-done], with all errors and results being settled.\n\nCompletion is handled by [`async-done` completion and error resolution][completions].\n\n#### `callback(error, result)`\n\nCalled on completion of `fn` and recieves a settled object as the `result` argument.\n\nThe `error` argument will always be `null`.\n\n#### Settled Object\n\nSettled values have two properties, `state` and `value`.\n\n`state` has two possible options `'error'` and `'success'`.\n\n`value` will be the value passed to original callback.\n\n## License\n\nMIT\n\n<!-- prettier-ignore-start -->\n[downloads-image]: https://img.shields.io/npm/dm/async-settle.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/async-settle\n[npm-image]: https://img.shields.io/npm/v/async-settle.svg?style=flat-square\n\n[ci-url]: https://github.com/gulpjs/async-settle/actions?query=workflow:dev\n[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/async-settle/dev?style=flat-square\n\n[coveralls-url]: https://coveralls.io/r/gulpjs/async-settle\n[coveralls-image]: https://img.shields.io/coveralls/gulpjs/async-settle/master.svg?style=flat-square\n<!-- prettier-ignore-end -->\n\n<!-- prettier-ignore-start -->\n[async-done]: https://github.com/gulpjs/async-done\n[completions]: https://github.com/gulpjs/async-done#completion-and-error-resolution\n<!-- prettier-ignore-end -->\n","_attachments":{},"homepage":"https://github.com/gulpjs/async-settle#readme","bugs":{"url":"https://github.com/gulpjs/async-settle/issues"},"license":"MIT"}