{"_id":"asyncreduce","_rev":"273706","name":"asyncreduce","description":"Reduce an array of values via an asynchronous function.","dist-tags":{"latest":"0.1.4"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"time":{"modified":"2021-06-03T17:52:21.000Z","created":"2013-07-19T13:57:32.104Z","0.1.4":"2013-07-27T15:32:48.103Z","0.1.3":"2013-07-27T14:44:14.133Z","0.1.2":"2013-07-19T16:23:18.580Z","0.1.1":"2013-07-19T14:03:50.747Z","0.1.0":"2013-07-19T14:02:16.814Z","0.0.1":"2013-07-19T13:57:32.104Z"},"users":{},"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"http://thlorenz.com"},"repository":{"type":"git","url":"git://github.com/thlorenz/asyncreduce.git"},"versions":{"0.1.4":{"name":"asyncreduce","version":"0.1.4","description":"Reduce an array of values via an asynchronous function.","main":"index.js","scripts":{"test-main":"tap test/*.js","test-0.8":"nave use 0.8 npm run test-main","test-0.10":"nave use 0.10 npm run test-main","test-all":"npm run test-main && npm run test-0.8 && npm run test-0.10 && npm run tape","test":"if [ -e $TRAVIS ]; then npm run test-all; else npm run test-main; fi","tape":"testling -x open","tape-dev":"browserify --debug ./test/*.js > ./test/browser/bundle.js && open test/browser/index.html"},"repository":{"type":"git","url":"git://github.com/thlorenz/asyncreduce.git"},"homepage":"https://github.com/thlorenz/asyncreduce","dependencies":{"runnel":"~0.5.0"},"devDependencies":{"nave":"~0.4.3","tape":"~1.0.4","tap":"~0.4.3","browserify":"~2.25.0","testling":"~1.5.1"},"keywords":["async","reduce","accumulate","accumulator","browser","browserify","iterate","iterator","initial"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"http://thlorenz.com"},"license":{"type":"MIT","url":"https://github.com/thlorenz/asyncreduce/blob/master/LICENSE"},"engine":{"node":">=0.6"},"testling":{"files":"test/*.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"readmeFilename":"README.md","bugs":{"url":"https://github.com/thlorenz/asyncreduce/issues"},"_id":"asyncreduce@0.1.4","dist":{"shasum":"18210e01978bfdcba043955497a5cd315c0a6a41","size":3773,"noattachment":false,"key":"/asyncreduce/-/asyncreduce-0.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/asyncreduce/download/asyncreduce-0.1.4.tgz"},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"directories":{},"publish_time":1374939168103,"_hasShrinkwrap":false,"_cnpm_publish_time":1374939168103},"0.1.3":{"name":"asyncreduce","version":"0.1.3","description":"Reduce an array of values via an asynchronous function.","main":"index.js","scripts":{"test-main":"tap test/*.js","test-0.8":"nave use 0.8 npm run test-main","test-0.10":"nave use 0.10 npm run test-main","test-all":"npm run test-main && npm run test-0.8 && npm run test-0.10 && npm run tape","test":"if [ -e $TRAVIS ]; then npm run test-all; else npm run test-main; fi","tape":"testling -x open","tape-dev":"browserify --debug ./test/*.js > ./test/browser/bundle.js && open test/browser/index.html"},"repository":{"type":"git","url":"git://github.com/thlorenz/asyncreduce.git"},"homepage":"https://github.com/thlorenz/asyncreduce","dependencies":{"runnel":"~0.5.0"},"devDependencies":{"nave":"~0.4.3","tape":"~1.0.4","tap":"~0.4.3","browserify":"~2.25.0","testling":"~1.5.1"},"keywords":["async","reduce","accumulate","accumulator","browser","browserify","iterate","iterator","initial"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"http://thlorenz.com"},"license":{"type":"MIT","url":"https://github.com/thlorenz/asyncreduce/blob/master/LICENSE"},"engine":{"node":">=0.6"},"testling":{"files":"test/*.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"readmeFilename":"README.md","bugs":{"url":"https://github.com/thlorenz/asyncreduce/issues"},"_id":"asyncreduce@0.1.3","dist":{"shasum":"5c01e5858fb39fab0669911edb1cf4ea2c44db9f","size":3733,"noattachment":false,"key":"/asyncreduce/-/asyncreduce-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/asyncreduce/download/asyncreduce-0.1.3.tgz"},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"directories":{},"publish_time":1374936254133,"_hasShrinkwrap":false,"_cnpm_publish_time":1374936254133},"0.1.2":{"name":"asyncreduce","version":"0.1.2","description":"Reduce an array of values via an asynchronous function.","main":"index.js","scripts":{"test-main":"tap test/*.js","test-0.8":"nave use 0.8 npm run test-main","test-0.10":"nave use 0.10 npm run test-main","test-all":"npm run test-main && npm run test-0.8 && npm run test-0.10","test":"if [ -e $TRAVIS ]; then npm run test-all; else npm run test-main; fi","tape":"browserify --debug ./test/*.js > ./test/browser/bundle.js && open test/browser/index.html"},"repository":{"type":"git","url":"git://github.com/thlorenz/asyncreduce.git"},"homepage":"https://github.com/thlorenz/asyncreduce","dependencies":{"runnel":"~0.5.0"},"devDependencies":{"nave":"~0.4.3","tape":"~1.0.4","tap":"~0.4.3","browserify":"~2.25.0"},"keywords":["async","reduce","accumulate","accumulator","browser","browserify","iterate","iterator","initial"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"http://thlorenz.com"},"license":{"type":"MIT","url":"https://github.com/thlorenz/asyncreduce/blob/master/LICENSE"},"engine":{"node":">=0.6"},"testling":{"files":"test/*.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"readmeFilename":"README.md","bugs":{"url":"https://github.com/thlorenz/asyncreduce/issues"},"_id":"asyncreduce@0.1.2","dist":{"shasum":"e49d15aa0f0c3d4eb223d0509dda9b7a3a511f5f","size":3830,"noattachment":false,"key":"/asyncreduce/-/asyncreduce-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/asyncreduce/download/asyncreduce-0.1.2.tgz"},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"directories":{},"publish_time":1374250998580,"_hasShrinkwrap":false,"_cnpm_publish_time":1374250998580},"0.1.1":{"name":"asyncreduce","version":"0.1.1","description":"Reduce an array of values via an asynchronous function.","main":"index.js","scripts":{"test-main":"tap test/*.js","test-0.8":"nave use 0.8 npm run test-main","test-0.10":"nave use 0.10 npm run test-main","test-all":"npm run test-main && npm run test-0.8 && npm run test-0.10","test":"if [ -e $TRAVIS ]; then npm run test-all; else npm run test-main; fi","tape":"browserify --debug ./test/*.js > ./test/browser/bundle.js && open test/browser/index.html"},"repository":{"type":"git","url":"git://github.com/thlorenz/asyncreduce.git"},"homepage":"https://github.com/thlorenz/asyncreduce","dependencies":{"runnel":"~0.5.0"},"devDependencies":{"nave":"~0.4.3","tape":"~1.0.4","tap":"~0.4.3","browserify":"~2.25.0"},"keywords":["async","reduce","accumulate","accumulator","browser","browserify","iterate","iterator","initial"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"http://thlorenz.com"},"license":{"type":"MIT","url":"https://github.com/thlorenz/asyncreduce/blob/master/LICENSE"},"engine":{"node":">=0.6"},"testling":{"files":"test/*.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"readmeFilename":"README.md","bugs":{"url":"https://github.com/thlorenz/asyncreduce/issues"},"_id":"asyncreduce@0.1.1","dist":{"shasum":"d56f801e6346febcb01502966568f26f916d1043","size":3783,"noattachment":false,"key":"/asyncreduce/-/asyncreduce-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/asyncreduce/download/asyncreduce-0.1.1.tgz"},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"directories":{},"publish_time":1374242630747,"_hasShrinkwrap":false,"_cnpm_publish_time":1374242630747},"0.1.0":{"name":"asyncreduce","version":"0.1.0","description":"Reduce an array of values via an asynchronous function.","main":"index.js","scripts":{"test-main":"tap test/*.js","test-0.8":"nave use 0.8 npm run test-main","test-0.10":"nave use 0.10 npm run test-main","test-all":"npm run test-main && npm run test-0.8 && npm run test-0.10","test":"if [ -e $TRAVIS ]; then npm run test-all; else npm run test-main; fi","tape":"browserify --debug ./test/*.js > ./test/browser/bundle.js && open test/browser/index.html"},"repository":{"type":"git","url":"git://github.com/thlorenz/asyncreduce.git"},"homepage":"https://github.com/thlorenz/asyncreduce","dependencies":{"runnel":"~0.5.0"},"devDependencies":{"nave":"~0.4.3","tape":"~1.0.4","tap":"~0.4.3","browserify":"~2.25.0"},"keywords":[],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"http://thlorenz.com"},"license":{"type":"MIT","url":"https://github.com/thlorenz/asyncreduce/blob/master/LICENSE"},"engine":{"node":">=0.6"},"testling":{"files":"test/*.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"readmeFilename":"README.md","bugs":{"url":"https://github.com/thlorenz/asyncreduce/issues"},"_id":"asyncreduce@0.1.0","dist":{"shasum":"055e4ad976cd91f4fffa83b064c9166ca75cab7f","size":3751,"noattachment":false,"key":"/asyncreduce/-/asyncreduce-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/asyncreduce/download/asyncreduce-0.1.0.tgz"},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"directories":{},"publish_time":1374242536814,"_hasShrinkwrap":false,"_cnpm_publish_time":1374242536814},"0.0.1":{"name":"asyncreduce","version":"0.0.1","description":"Reduce an array of values via an asynchronous function.","main":"index.js","scripts":{"test-main":"tap test/*.js","test-0.8":"nave use 0.8 npm run test-main","test-0.10":"nave use 0.10 npm run test-main","test-all":"npm run test-main && npm run test-0.8 && npm run test-0.10","test":"if [ -e $TRAVIS ]; then npm run test-all; else npm run test-main; fi","tape":"browserify --debug ./test/*.js > ./test/browser/bundle.js && open test/browser/index.html"},"repository":{"type":"git","url":"git://github.com/thlorenz/asyncreduce.git"},"homepage":"https://github.com/thlorenz/asyncreduce","dependencies":{"runnel":"~0.5.0"},"devDependencies":{"nave":"~0.4.3","tape":"~1.0.4","tap":"~0.4.3","browserify":"~2.25.0"},"keywords":[],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"http://thlorenz.com"},"license":{"type":"MIT","url":"https://github.com/thlorenz/asyncreduce/blob/master/LICENSE"},"engine":{"node":">=0.6"},"testling":{"files":"test/*.js","browsers":["ie/8..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"readmeFilename":"README.md","bugs":{"url":"https://github.com/thlorenz/asyncreduce/issues"},"_id":"asyncreduce@0.0.1","dist":{"shasum":"ab11662e413879a8df6c66f3f7bd99af83313a7a","size":3692,"noattachment":false,"key":"/asyncreduce/-/asyncreduce-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/asyncreduce/download/asyncreduce-0.0.1.tgz"},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"directories":{},"publish_time":1374242252104,"_hasShrinkwrap":false,"_cnpm_publish_time":1374242252104}},"readme":"# asyncreduce [![build status](https://secure.travis-ci.org/thlorenz/asyncreduce.png)](http://travis-ci.org/thlorenz/asyncreduce)\n\nReduce an array of values via an asynchronous function.\n\n```js\nvar fs = require('fs');\nvar path = require('path');\nvar asyncReduce = require('asyncreduce);\n\nasyncReduce(\n    [ '.gitignore', '.jshintrc', '.travis.yml', 'index.js', 'Readme.md' ]\n  , {}\n  , function size (acc, file, cb) {\n      var p = path.join(__dirname, '..', file);\n\n      fs.stat(p, function (err, stat) {\n        if (err) return cb(err);\n\n        acc[file] = stat.size;\n        cb(null, acc);\n      });\n    }\n  , function done (err, acc) {\n      if (err) return console.error(err);\n      console.log('sizes:\\n', acc);\n    }\n);\n```\n\n## Features\n\n- super small library built on top of also quite small [runnel](https://github.com/thlorenz/runnel)\n- since runnel `try/catch`es and bubbles errors and reports with detailed stack traces, so does asyncreduce\n\n## Installation\n\n    npm install asyncreduce\n\n### In the browser\n\n#### With [browserify](https://github.com/substack/node-browserify)\n\nYou are all good.\n\n#### Without browserify\n\nTwo options:\n\n  - run [browserify --standalone](https://github.com/substack/node-browserify#usage) after installing this package via\n    npm\n  - TODO: browserify-cdn\n\n## API\n\n### *function asyncReduce (items, seed, iterator, done)*\n\n```\n/**\n * Calls provided async iterator function with the accumulator and each item.\n * When all items have been iterated over calls done with a possible error or the final value of the accumulator.\n *\n * @name exports\n * @function\n * @param items {Array} the items to be reduced\n * @param seed {T} the initial value that can be of any type and is passed along as the accumulator (acc) each time the iterator is called\n * @param iterator {Function} function (acc, item, callback) {} - the iterator called for each item\n * @param done {Function} function (err, acc) {} - called with final accumulated value or an error if one occurred\n */\n```\n\n## License\n\nMIT\n","_attachments":{},"readmeFilename":"README.md","homepage":"https://github.com/thlorenz/asyncreduce","bugs":{"url":"https://github.com/thlorenz/asyncreduce/issues"},"license":{"type":"MIT","url":"https://github.com/thlorenz/asyncreduce/blob/master/LICENSE"}}