{"bugs":{"url":"https://github.com/thlorenz/asyncreduce/issues"},"dist":{"shasum":"ab11662e413879a8df6c66f3f7bd99af83313a7a","tarball":"https://registry.npmjs.org/asyncreduce/-/asyncreduce-0.0.1.tgz","integrity":"sha512-3gdwRIuoDFotcUnvVCb59Rju53By68TW4e+HLPOHIosqmXiy/QEs/aHdqWyC4IbDppdVXfo3ecgbT6Wz0BwaWg==","signatures":[{"sig":"MEQCICAXdsAMtQ6oKxkLw4usPkj7oUvVHExDKdU99IEvv990AiBfrOE72wecm2CqrKC4z1AeCjm7LIv3vJ1T8otM9hxcNQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","name":"asyncreduce","_from":".","author":{"url":"http://thlorenz.com","name":"Thorsten Lorenz","email":"thlorenz@gmx.de"},"engine":{"node":">=0.6"},"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","license":{"url":"https://github.com/thlorenz/asyncreduce/blob/master/LICENSE","type":"MIT"},"scripts":{"tape":"browserify --debug ./test/*.js > ./test/browser/bundle.js && open test/browser/index.html","test":"if [ -e $TRAVIS ]; then npm run test-all; else npm run test-main; fi","test-0.8":"nave use 0.8 npm run test-main","test-all":"npm run test-main && npm run test-0.8 && npm run test-0.10","test-0.10":"nave use 0.10 npm run test-main","test-main":"tap test/*.js"},"_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"homepage":"https://github.com/thlorenz/asyncreduce","keywords":[],"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"]},"repository":{"url":"git://github.com/thlorenz/asyncreduce.git","type":"git"},"_npmVersion":"1.3.2","description":"Reduce an array of values via an asynchronous function.","directories":{},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"dependencies":{"runnel":"~0.5.0"},"readmeFilename":"README.md","devDependencies":{"tap":"~0.4.3","nave":"~0.4.3","tape":"~1.0.4","browserify":"~2.25.0"},"_id":"asyncreduce@0.0.1","version":"0.0.1"}