pax_global_header00006660000000000000000000000064127574260360014526gustar00rootroot0000000000000052 comment=f2342d85633d0dc1034a49387ca01c08c1189823 async-each-1.0.1/000077500000000000000000000000001275742603600135405ustar00rootroot00000000000000async-each-1.0.1/.gitignore000066400000000000000000000003611275742603600155300ustar00rootroot00000000000000# Numerous always-ignore extensions *.diff *.err *.orig *.log *~ # OS or Editor folders .DS_Store .cache Icon? # Folders to ignore .hg .svn # Node.js package manager /node_modules /npm-debug.log # Other stuff *.pyc /tmp # Project stuff async-each-1.0.1/CHANGELOG.md000066400000000000000000000011211275742603600153440ustar00rootroot00000000000000# async-each 1.0.0 (26 November 2015) * Bumped version to 1.0.0 (no functional changes) # async-each 0.1.6 (5 November 2014) * Add license to package.json # async-each 0.1.5 (22 October 2014) * Clean up package.json to fix npm warning about `repo` # async-each 0.1.4 (12 November 2013) * Fixed AMD definition. # async-each 0.1.3 (25 July 2013) * Fixed double wrapping of errors. # async-each 0.1.2 (7 July 2013) * Fixed behaviour on empty arrays. # async-each 0.1.1 (14 June 2013) * Wrapped function in closure, enabled strict mode. # async-each 0.1.0 (14 June 2013) * Initial release. async-each-1.0.1/README.md000066400000000000000000000021421275742603600150160ustar00rootroot00000000000000# async-each No-bullshit, ultra-simple, 35-lines-of-code async parallel forEach function for JavaScript. We don't need junky 30K async libs. Really. For browsers and node.js. ## Installation * Just include async-each before your scripts. * `npm install async-each` if you’re using node.js. * `bower install async-each` if you’re using [Bower](http://bower.io). ## Usage * `each(array, iterator, callback);` — `Array`, `Function`, `(optional) Function` * `iterator(item, next)` receives current item and a callback that will mark the item as done. `next` callback receives optional `error, transformedItem` arguments. * `callback(error, transformedArray)` optionally receives first error and transformed result `Array`. Node.js: ```javascript var each = require('async-each'); each(['a.js', 'b.js', 'c.js'], fs.readFile, function(error, contents) { if (error) console.error(error); console.log('Contents for a, b and c:', contents); }); ``` Browser: ```javascript window.asyncEach(list, fn, callback); ``` ## License [The MIT License](https://raw.githubusercontent.com/paulmillr/mit/master/README.md) async-each-1.0.1/bower.json000066400000000000000000000010171275742603600155500ustar00rootroot00000000000000{ "name": "async-each", "repo": "paulmillr/async-each", "description": "No-bullshit, ultra-simple, 35-lines-of-code async parallel forEach / map function for JavaScript.", "version": "1.0.1", "keywords": [ "async", "forEach", "each", "map", "asynchronous", "iteration", "iterate", "loop", "parallel", "concurrent", "array", "flow", "control flow" ], "main": "index.js", "dependencies": {}, "development": {}, "ignore": [ "**/.*", "node_modules", "bower_components" ] } async-each-1.0.1/component.json000066400000000000000000000007371275742603600164440ustar00rootroot00000000000000{ "name": "async-each", "repo": "paulmillr/async-each", "description": "No-bullshit, ultra-simple, 35-lines-of-code async parallel forEach / map function for JavaScript.", "version": "1.0.1", "keywords": [ "async", "forEach", "each", "map", "asynchronous", "iteration", "iterate", "loop", "parallel", "concurrent", "array", "flow", "control flow" ], "main": "index.js", "scripts": ["index.js"], "dependencies": {}, "development": {} } async-each-1.0.1/index.js000066400000000000000000000023571275742603600152140ustar00rootroot00000000000000// async-each MIT license (by Paul Miller from http://paulmillr.com). (function(globals) { 'use strict'; var each = function(items, next, callback) { if (!Array.isArray(items)) throw new TypeError('each() expects array as first argument'); if (typeof next !== 'function') throw new TypeError('each() expects function as second argument'); if (typeof callback !== 'function') callback = Function.prototype; // no-op if (items.length === 0) return callback(undefined, items); var transformed = new Array(items.length); var count = 0; var returned = false; items.forEach(function(item, index) { next(item, function(error, transformedItem) { if (returned) return; if (error) { returned = true; return callback(error); } transformed[index] = transformedItem; count += 1; if (count === items.length) return callback(undefined, transformed); }); }); }; if (typeof define !== 'undefined' && define.amd) { define([], function() { return each; }); // RequireJS } else if (typeof module !== 'undefined' && module.exports) { module.exports = each; // CommonJS } else { globals.asyncEach = each; //