{"_id":"run-async","_rev":"4049449","name":"run-async","description":"Utility method to run function either synchronously or asynchronously using the common `this.async()` style.","dist-tags":{"latest":"4.0.6"},"maintainers":[{"name":"sboudrias","email":""}],"time":{"modified":"2025-09-01T06:33:58.000Z","created":"2014-08-11T01:11:31.399Z","4.0.6":"2025-08-08T14:17:06.831Z","4.0.5":"2025-07-21T13:40:04.084Z","4.0.4":"2025-06-19T19:51:09.541Z","4.0.3":"2025-06-19T19:41:23.755Z","4.0.2":"2025-06-19T19:18:07.370Z","4.0.1":"2025-06-19T19:05:34.200Z","4.0.0":"2025-06-19T18:57:14.198Z","3.0.0":"2023-05-07T19:59:36.453Z","2.4.1":"2020-04-27T05:40:09.368Z","2.4.0":"2020-02-26T10:06:22.816Z","2.3.0":"2016-12-02T05:18:24.544Z","2.2.0":"2016-03-17T07:09:37.775Z","2.1.0":"2016-01-14T06:51:30.979Z","2.0.0":"2015-10-18T21:12:16.901Z","1.0.0":"2015-10-13T06:10:24.777Z","0.1.0":"2014-08-11T01:11:31.399Z"},"users":{"itonyyo":true,"71emj1":true},"author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"repository":{"type":"git","url":"git+https://github.com/SBoudrias/run-async.git"},"versions":{"4.0.6":{"name":"run-async","version":"4.0.6","description":"Utility method to run function either synchronously or asynchronously using the common `this.async()` style.","exports":{"./package.json":"./package.json",".":{"types":"./index.d.ts","default":"./index.js"}},"sideEffects":false,"scripts":{"test":"node --test test.js","lint":"npx oxlint && npx prettier --check ."},"engines":{"node":">=0.12.0"},"repository":{"type":"git","url":"git+https://github.com/SBoudrias/run-async.git"},"keywords":["flow","flow-control","async"],"author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"license":"MIT","devDependencies":{"oxlint":"^1.2.0","prettier":"^3.5.3"},"types":"./index.d.ts","gitHead":"0d81888399d3d47656dd4762e2aa1982a79c8df9","bugs":{"url":"https://github.com/SBoudrias/run-async/issues"},"homepage":"https://github.com/SBoudrias/run-async#readme","_id":"run-async@4.0.6","_nodeVersion":"24.4.1","_npmVersion":"8.19.2","dist":{"shasum":"d53b86acb71f42650fe23de2b3c1b6b6b34b9294","size":3232,"noattachment":false,"key":"/run-async/-/run-async-4.0.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/run-async/download/run-async-4.0.6.tgz"},"_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"directories":{},"maintainers":[{"name":"sboudrias","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/run-async_4.0.6_1754662626580_0.5603995517035782"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-08-08T14:17:06.831Z","publish_time":1754662626831,"_source_registry_name":"default","_cnpm_publish_time":1754662626831},"4.0.5":{"name":"run-async","version":"4.0.5","description":"Utility method to run function either synchronously or asynchronously using the common `this.async()` style.","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"scripts":{"test":"node --test test.js","lint":"npx oxlint && npx prettier --check ."},"engines":{"node":">=0.12.0"},"repository":{"type":"git","url":"git+https://github.com/SBoudrias/run-async.git"},"keywords":["flow","flow-control","async"],"author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"license":"MIT","devDependencies":{"oxlint":"^1.2.0","prettier":"^3.5.3"},"types":"./index.d.ts","gitHead":"3bb1d867eaf778b43f03e0203e5dcf477275b2e7","bugs":{"url":"https://github.com/SBoudrias/run-async/issues"},"homepage":"https://github.com/SBoudrias/run-async#readme","_id":"run-async@4.0.5","_nodeVersion":"24.2.0","_npmVersion":"8.19.2","dist":{"shasum":"8856ec2986c6e20372f5edf0416f9c1140e7f56e","size":3218,"noattachment":false,"key":"/run-async/-/run-async-4.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/run-async/download/run-async-4.0.5.tgz"},"_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"directories":{},"maintainers":[{"name":"sboudrias","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/run-async_4.0.5_1753105203907_0.5580229570282738"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-07-21T13:40:04.084Z","publish_time":1753105204084,"_source_registry_name":"default","_cnpm_publish_time":1753105204084},"4.0.4":{"name":"run-async","version":"4.0.4","description":"Utility method to run function either synchronously or asynchronously using the common `this.async()` style.","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"scripts":{"test":"node --test test.js","lint":"npx oxlint && npx prettier --check ."},"engines":{"node":">=0.12.0"},"repository":{"type":"git","url":"git+https://github.com/SBoudrias/run-async.git"},"keywords":["flow","flow-control","async"],"author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"license":"MIT","dependencies":{"oxlint":"^1.2.0","prettier":"^3.5.3"},"types":"./index.d.ts","gitHead":"2393661dba9b056fa17a600e062ba580530d9aed","bugs":{"url":"https://github.com/SBoudrias/run-async/issues"},"homepage":"https://github.com/SBoudrias/run-async#readme","_id":"run-async@4.0.4","_nodeVersion":"22.13.0","_npmVersion":"8.19.2","dist":{"shasum":"6855326c7ba59358979f7be96d30b972484d63db","size":3215,"noattachment":false,"key":"/run-async/-/run-async-4.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/run-async/download/run-async-4.0.4.tgz"},"_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com","actor":{"name":"sboudrias","email":"admin@simonboudrias.com","type":"user"}},"directories":{},"maintainers":[{"name":"sboudrias","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/run-async_4.0.4_1750362669358_0.3793481282225979"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-06-19T19:51:09.541Z","publish_time":1750362669541,"_source_registry_name":"default","_cnpm_publish_time":1750362669541},"4.0.3":{"name":"run-async","version":"4.0.3","description":"Utility method to run function either synchronously or asynchronously using the common `this.async()` style.","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"scripts":{"test":"node --test test.js","lint":"npx oxlint && npx prettier --check ."},"engines":{"node":">=0.12.0"},"repository":{"type":"git","url":"git+https://github.com/SBoudrias/run-async.git"},"keywords":["flow","flow-control","async"],"author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"license":"MIT","dependencies":{"oxlint":"^1.2.0","prettier":"^3.5.3"},"types":"./index.d.ts","gitHead":"ccead83709c9e6bf6037a1a6f4acbf538c7ab61f","bugs":{"url":"https://github.com/SBoudrias/run-async/issues"},"homepage":"https://github.com/SBoudrias/run-async#readme","_id":"run-async@4.0.3","_nodeVersion":"22.13.0","_npmVersion":"8.19.2","dist":{"shasum":"630f805b5854d0b11cf1117d4a51fb6d63d10e23","size":3204,"noattachment":false,"key":"/run-async/-/run-async-4.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/run-async/download/run-async-4.0.3.tgz"},"_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com","actor":{"name":"sboudrias","email":"admin@simonboudrias.com","type":"user"}},"directories":{},"maintainers":[{"name":"sboudrias","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/run-async_4.0.3_1750362083564_0.30440514931665885"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-06-19T19:41:23.755Z","publish_time":1750362083755,"_source_registry_name":"default","_cnpm_publish_time":1750362083755},"4.0.2":{"name":"run-async","version":"4.0.2","description":"Utility method to run function either synchronously or asynchronously using the common `this.async()` style.","main":"src/index.js","types":"src/index.d.ts","scripts":{"test":"node --test test.js","lint":"npx oxlint"},"engines":{"node":">=0.12.0"},"repository":{"type":"git","url":"git+https://github.com/SBoudrias/run-async.git"},"keywords":["flow","flow-control","async"],"author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"license":"MIT","dependencies":{"oxlint":"^1.2.0"},"gitHead":"96c004cb7e8912308f31b3ed9d56a8ed8de79826","bugs":{"url":"https://github.com/SBoudrias/run-async/issues"},"homepage":"https://github.com/SBoudrias/run-async#readme","_id":"run-async@4.0.2","_nodeVersion":"22.13.0","_npmVersion":"8.19.2","dist":{"shasum":"fb457f3c7f8d449e92c33a38b87f9cb2bcb9e531","size":3146,"noattachment":false,"key":"/run-async/-/run-async-4.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/run-async/download/run-async-4.0.2.tgz"},"_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com","actor":{"name":"sboudrias","email":"admin@simonboudrias.com","type":"user"}},"directories":{},"maintainers":[{"name":"sboudrias","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/run-async_4.0.2_1750360687187_0.7333758006033446"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-06-19T19:18:07.370Z","publish_time":1750360687370,"_source_registry_name":"default","_cnpm_publish_time":1750360687370},"4.0.1":{"name":"run-async","version":"4.0.1","description":"Utility method to run function either synchronously or asynchronously using the common `this.async()` style.","main":"src/index.js","scripts":{"test":"node --test test.js","lint":"npx oxlint"},"engines":{"node":">=0.12.0"},"repository":{"type":"git","url":"git+https://github.com/SBoudrias/run-async.git"},"keywords":["flow","flow-control","async"],"author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"license":"MIT","dependencies":{"oxlint":"^1.2.0"},"types":"./src/index.d.ts","gitHead":"de09f239b7f4bffa2b9fc2f6894749ea656c7956","bugs":{"url":"https://github.com/SBoudrias/run-async/issues"},"homepage":"https://github.com/SBoudrias/run-async#readme","_id":"run-async@4.0.1","_nodeVersion":"22.13.0","_npmVersion":"8.19.2","dist":{"shasum":"2efb233b081d086c3a9212ca86a2286925a3da9f","size":3141,"noattachment":false,"key":"/run-async/-/run-async-4.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/run-async/download/run-async-4.0.1.tgz"},"_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com","actor":{"name":"sboudrias","email":"admin@simonboudrias.com","type":"user"}},"directories":{},"maintainers":[{"name":"sboudrias","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/run-async_4.0.1_1750359934013_0.28958225854943676"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-06-19T19:05:34.200Z","publish_time":1750359934200,"_source_registry_name":"default","_cnpm_publish_time":1750359934200},"4.0.0":{"name":"run-async","version":"4.0.0","description":"Utility method to run function either synchronously or asynchronously using the common `this.async()` style.","main":"index.js","scripts":{"test":"node --test test.js","lint":"npx oxlint"},"engines":{"node":">=0.12.0"},"repository":{"type":"git","url":"git+https://github.com/SBoudrias/run-async.git"},"keywords":["flow","flow-control","async"],"author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"license":"MIT","dependencies":{"oxlint":"^1.2.0"},"types":"./index.d.ts","gitHead":"56d7d14807f2ffb3a930325822bf81f1615e1229","bugs":{"url":"https://github.com/SBoudrias/run-async/issues"},"homepage":"https://github.com/SBoudrias/run-async#readme","_id":"run-async@4.0.0","_nodeVersion":"22.13.0","_npmVersion":"8.19.2","dist":{"shasum":"9c5f442e83eec00e033bb8458f64b6c191791156","size":3025,"noattachment":false,"key":"/run-async/-/run-async-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/run-async/download/run-async-4.0.0.tgz"},"_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com","actor":{"name":"sboudrias","email":"admin@simonboudrias.com","type":"user"}},"directories":{},"maintainers":[{"name":"sboudrias","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/run-async_4.0.0_1750359434006_0.32491719162179256"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-06-19T18:57:14.198Z","publish_time":1750359434198,"_source_registry_name":"default","_cnpm_publish_time":1750359434198},"3.0.0":{"name":"run-async","version":"3.0.0","description":"Utility method to run function either synchronously or asynchronously using the common `this.async()` style.","main":"index.js","scripts":{"test":"mocha -R spec"},"engines":{"node":">=0.12.0"},"repository":{"type":"git","url":"git+https://github.com/SBoudrias/run-async.git"},"keywords":["flow","flow-control","async"],"author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"license":"MIT","devDependencies":{"mocha":"^10.2.0"},"gitHead":"4d2d46bb161f69ae6358089820db08b11ea60896","bugs":{"url":"https://github.com/SBoudrias/run-async/issues"},"homepage":"https://github.com/SBoudrias/run-async#readme","_id":"run-async@3.0.0","_nodeVersion":"16.17.1","_npmVersion":"8.19.2","dist":{"shasum":"42a432f6d76c689522058984384df28be379daad","size":3084,"noattachment":false,"key":"/run-async/-/run-async-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/run-async/download/run-async-3.0.0.tgz"},"_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"directories":{},"maintainers":[{"name":"sboudrias","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/run-async_3.0.0_1683489576261_0.5867186636383466"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-05-07T19:59:36.453Z","publish_time":1683489576453,"_source_registry_name":"default","_cnpm_publish_time":1683489576453},"2.4.1":{"name":"run-async","version":"2.4.1","description":"Utility method to run function either synchronously or asynchronously using the common `this.async()` style.","main":"index.js","scripts":{"test":"mocha -R spec"},"engines":{"node":">=0.12.0"},"repository":{"type":"git","url":"git+https://github.com/SBoudrias/run-async.git"},"keywords":["flow","flow-control","async"],"author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"license":"MIT","dependencies":{},"devDependencies":{"mocha":"^7.1.0"},"gitHead":"f3e0a18abf6e9569abfcf327daa9351c95f109b1","bugs":{"url":"https://github.com/SBoudrias/run-async/issues"},"homepage":"https://github.com/SBoudrias/run-async#readme","_id":"run-async@2.4.1","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"shasum":"8440eccf99ea3e70bd409d49aab88e10c189a455","size":2782,"noattachment":false,"key":"/run-async/-/run-async-2.4.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/run-async/download/run-async-2.4.1.tgz"},"maintainers":[{"name":"sboudrias","email":""}],"_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/run-async_2.4.1_1587966009268_0.1932416029427002"},"_hasShrinkwrap":false,"publish_time":1587966009368,"_cnpm_publish_time":1587966009368},"2.4.0":{"name":"run-async","version":"2.4.0","description":"Utility method to run function either synchronously or asynchronously using the common `this.async()` style.","main":"index.js","scripts":{"test":"mocha -R spec"},"engines":{"node":">=0.12.0"},"repository":{"type":"git","url":"git+https://github.com/SBoudrias/run-async.git"},"keywords":["flow","flow-control","async"],"author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"license":"MIT","dependencies":{"is-promise":"^2.1.0"},"devDependencies":{"mocha":"^7.1.0"},"gitHead":"6dc42ae3c416e4c4feb9069720f4e7c7796c4e15","bugs":{"url":"https://github.com/SBoudrias/run-async/issues"},"homepage":"https://github.com/SBoudrias/run-async#readme","_id":"run-async@2.4.0","_nodeVersion":"13.8.0","_npmVersion":"6.13.7","dist":{"shasum":"e59054a5b86876cfae07f431d18cbaddc594f1e8","size":2747,"noattachment":false,"key":"/run-async/-/run-async-2.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/run-async/download/run-async-2.4.0.tgz"},"maintainers":[{"name":"sboudrias","email":""}],"_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/run-async_2.4.0_1582711582706_0.5107281545660194"},"_hasShrinkwrap":false,"publish_time":1582711582816,"_cnpm_publish_time":1582711582816},"2.3.0":{"name":"run-async","version":"2.3.0","description":"Utility method to run function either synchronously or asynchronously using the common `this.async()` style.","main":"index.js","scripts":{"test":"mocha -R spec"},"engines":{"node":">=0.12.0"},"repository":{"type":"git","url":"git+https://github.com/sboudrias/run-async.git"},"keywords":["flow","flow-control","async"],"files":["index.js"],"author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"license":"MIT","dependencies":{"is-promise":"^2.1.0"},"devDependencies":{"mocha":"^3.1.2"},"gitHead":"23767c9d7eaf6a6bb1241fc9e12776685258c50e","bugs":{"url":"https://github.com/sboudrias/run-async/issues"},"homepage":"https://github.com/sboudrias/run-async#readme","_id":"run-async@2.3.0","_shasum":"0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0","_from":".","_npmVersion":"3.10.8","_nodeVersion":"7.0.0","_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"dist":{"shasum":"0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0","size":2473,"noattachment":false,"key":"/run-async/-/run-async-2.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/run-async/download/run-async-2.3.0.tgz"},"maintainers":[{"name":"sboudrias","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/run-async-2.3.0.tgz_1480655904296_0.6874290609266609"},"directories":{},"publish_time":1480655904544,"_cnpm_publish_time":1480655904544,"_hasShrinkwrap":false},"2.2.0":{"name":"run-async","version":"2.2.0","description":"Utility method to run function either synchronously or asynchronously using the common `this.async()` style.","main":"index.js","scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git+https://github.com/sboudrias/run-async.git"},"keywords":["flow","flow-control","async"],"author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"license":"MIT","dependencies":{"is-promise":"^2.1.0","pinkie-promise":"^2.0.0"},"devDependencies":{"mocha":"^2.3.3"},"gitHead":"5c6dc70500fd5c0b6ab1ba93f5f1a3338bfeaa84","bugs":{"url":"https://github.com/sboudrias/run-async/issues"},"homepage":"https://github.com/sboudrias/run-async#readme","_id":"run-async@2.2.0","_shasum":"8783abd83c7bb86f41ee0602fc82404b3bd6e8b9","_from":".","_npmVersion":"3.5.3","_nodeVersion":"5.2.0","_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"dist":{"shasum":"8783abd83c7bb86f41ee0602fc82404b3bd6e8b9","size":3623,"noattachment":false,"key":"/run-async/-/run-async-2.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/run-async/download/run-async-2.2.0.tgz"},"maintainers":[{"name":"sboudrias","email":""}],"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/run-async-2.2.0.tgz_1458198577245_0.4591540393885225"},"directories":{},"publish_time":1458198577775,"_cnpm_publish_time":1458198577775,"_hasShrinkwrap":false},"2.1.0":{"name":"run-async","version":"2.1.0","description":"Utility method to run function either synchronously or asynchronously using the common `this.async()` style.","main":"index.js","scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/SBoudrias/run-async.git"},"keywords":["flow","flow-control","async"],"author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"license":"MIT","bugs":{"url":"https://github.com/SBoudrias/run-async/issues"},"homepage":"https://github.com/SBoudrias/run-async","dependencies":{"is-promise":"^2.1.0","promise-resolver":"^3.0.0"},"devDependencies":{"mocha":"^2.3.3","pinkie":"^1.0.0"},"gitHead":"766bfe282253b4c2628ead1b6e6dcf7511a5fcc7","_id":"run-async@2.1.0","_shasum":"2505300a22be63202297a9494b6f5f5c441ccd23","_from":".","_npmVersion":"3.5.3","_nodeVersion":"5.2.0","_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"dist":{"shasum":"2505300a22be63202297a9494b6f5f5c441ccd23","size":3773,"noattachment":false,"key":"/run-async/-/run-async-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/run-async/download/run-async-2.1.0.tgz"},"maintainers":[{"name":"sboudrias","email":""}],"directories":{},"publish_time":1452754290979,"_cnpm_publish_time":1452754290979,"_hasShrinkwrap":false},"2.0.0":{"name":"run-async","version":"2.0.0","description":"Utility method to run function either synchronously or asynchronously using the common `this.async()` style.","main":"index.js","scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/SBoudrias/run-async.git"},"keywords":["flow","flow-control","async"],"author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"license":"MIT","bugs":{"url":"https://github.com/SBoudrias/run-async/issues"},"homepage":"https://github.com/SBoudrias/run-async","dependencies":{"is-promise":"^2.1.0","once":"^1.3.0","promise-resolver":"^1.0.0"},"devDependencies":{"bluebird":"^2.10.2","mocha":"^1.21.4"},"gitHead":"80220998e71abb21d87367c562821d23efea2643","_id":"run-async@2.0.0","_shasum":"bc9e25f25f40992375f2533aa381e355da412616","_from":".","_npmVersion":"2.14.2","_nodeVersion":"0.12.7","_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"dist":{"shasum":"bc9e25f25f40992375f2533aa381e355da412616","size":3543,"noattachment":false,"key":"/run-async/-/run-async-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/run-async/download/run-async-2.0.0.tgz"},"maintainers":[{"name":"sboudrias","email":""}],"directories":{},"publish_time":1445202736901,"_cnpm_publish_time":1445202736901,"_hasShrinkwrap":false},"1.0.0":{"name":"run-async","version":"1.0.0","description":"Utility method to run function either synchronously or asynchronously using the common `this.async()` style.","main":"index.js","scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/SBoudrias/run-async.git"},"keywords":["flow","flow-control","async"],"author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"license":"MIT","bugs":{"url":"https://github.com/SBoudrias/run-async/issues"},"homepage":"https://github.com/SBoudrias/run-async","dependencies":{"is-promise":"^2.1.0","once":"^1.3.0"},"devDependencies":{"bluebird":"^2.10.2","mocha":"^1.21.4"},"gitHead":"3f7174fac180c9e90bd4ecff9956c2ceb7d731ba","_id":"run-async@1.0.0","_shasum":"5a63bec4fdc3331786f9758861a7f27000c0e9e1","_from":".","_npmVersion":"2.14.2","_nodeVersion":"0.12.7","_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"dist":{"shasum":"5a63bec4fdc3331786f9758861a7f27000c0e9e1","size":3017,"noattachment":false,"key":"/run-async/-/run-async-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/run-async/download/run-async-1.0.0.tgz"},"maintainers":[{"name":"sboudrias","email":""}],"directories":{},"publish_time":1444716624777,"_cnpm_publish_time":1444716624777,"_hasShrinkwrap":false},"0.1.0":{"name":"run-async","version":"0.1.0","description":"Utility method to run function either synchronously or asynchronously using the common `this.async()` style.","main":"index.js","scripts":{"test":"mocha -R spec"},"repository":{"type":"git","url":"git://github.com/SBoudrias/run-async"},"keywords":["flow","flow-control","async"],"author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"license":"MIT","bugs":{"url":"https://github.com/SBoudrias/run-async/issues"},"homepage":"https://github.com/SBoudrias/run-async","dependencies":{"once":"^1.3.0"},"devDependencies":{"mocha":"^1.21.4"},"_id":"run-async@0.1.0","dist":{"shasum":"c8ad4a5e110661e402a7d21b530e009f25f8e389","size":2603,"noattachment":false,"key":"/run-async/-/run-async-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/run-async/download/run-async-0.1.0.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"maintainers":[{"name":"sboudrias","email":""}],"directories":{},"publish_time":1407719491399,"_cnpm_publish_time":1407719491399,"_hasShrinkwrap":false}},"readme":"# Run Async\n\n[![npm](https://badge.fury.io/js/run-async.svg)](http://badge.fury.io/js/run-async)\n\nUtility method to run a function either synchronously or asynchronously using a series of common patterns. This is useful for library author accepting sync or async functions as parameter. `runAsync` will always run them as an async method, and normalize the multiple signature.\n\n# Installation\n\n```bash\nnpm install --save run-async\n```\n\n# Usage\n\nHere's a simple example print the function results and three options a user can provide a function.\n\n```js\nvar runAsync = require(\"run-async\");\n\nvar printAfter = function (func) {\n  var cb = function (err, returnValue) {\n    console.log(returnValue);\n  };\n  runAsync(func, cb)(/* arguments for func */);\n};\n```\n\n#### Using `this.async`\n\n```js\nprintAfter(function () {\n  var done = this.async();\n\n  setTimeout(function () {\n    done(null, \"done running with callback\");\n  }, 10);\n});\n```\n\n#### Returning a promise\n\n```js\nprintAfter(function () {\n  return new Promise(function (resolve, reject) {\n    resolve(\"done running with promises\");\n  });\n});\n```\n\n#### Synchronous function\n\n```js\nprintAfter(function () {\n  return \"done running sync function\";\n});\n```\n\n#### Custom done factory\n\n```js\nvar runAsync = require(\"run-async\");\n\nrunAsync(function () {\n  var callback = this.customAsync();\n  callback(null, a + b);\n}, \"customAsync\")(1, 2);\n```\n\n#### Passing context to async method\n\n```js\nvar runAsync = require(\"run-async\");\n\nrunAsync(function () {\n  assert(this.isBound);\n  var callback = this.async();\n  callback(null, a + b);\n}).call({ isBound: true }, 1, 2);\n```\n\n### runAsync.cb\n\n`runAsync.cb` supports all the function types that `runAsync` does and additionally a traditional **callback as the last argument** signature:\n\n```js\nvar runAsync = require(\"run-async\");\n\n// IMPORTANT: The wrapped function must have a fixed number of parameters.\nrunAsync.cb(\n  function (a, b, cb) {\n    cb(null, a + b);\n  },\n  function (err, result) {\n    console.log(result);\n  },\n)(1, 2);\n```\n\nIf your version of node support Promises natively (node >= 0.12), `runAsync` will return a promise. Example: `runAsync(func)(arg1, arg2).then(cb)`\n\n# Licence\n\nCopyright (c) 2014 Simon Boudrias (twitter: @vaxilart)  \nLicensed under the MIT license.\n","_attachments":{},"homepage":"https://github.com/SBoudrias/run-async#readme","bugs":{"url":"https://github.com/SBoudrias/run-async/issues"},"license":"MIT"}