Bug:Fix file validation issue
[vnfsdk/refrepo.git] / vnfmarket / src / main / webapp / vnfmarket / node_modules / async-each / README.md
1 # async-each
2
3 No-bullshit, ultra-simple, 35-lines-of-code async parallel forEach function for JavaScript.
4
5 We don't need junky 30K async libs. Really.
6
7 For browsers and node.js.
8
9 ## Installation
10 * Just include async-each before your scripts.
11 * `npm install async-each` if you’re using node.js.
12 * `bower install async-each` if you’re using [Bower](http://bower.io).
13
14 ## Usage
15
16 * `each(array, iterator, callback);` — `Array`, `Function`, `(optional) Function`
17 * `iterator(item, next)` receives current item and a callback that will mark the item as done. `next` callback receives optional `error, transformedItem` arguments.
18 * `callback(error, transformedArray)` optionally receives first error and transformed result `Array`.
19
20 Node.js:
21
22 ```javascript
23 var each = require('async-each');
24 each(['a.js', 'b.js', 'c.js'], fs.readFile, function(error, contents) {
25   if (error) console.error(error);
26   console.log('Contents for a, b and c:', contents);
27 });
28 ```
29
30 Browser:
31
32 ```javascript
33 window.asyncEach(list, fn, callback);
34 ```
35
36 ## License
37
38 [The MIT License](https://raw.githubusercontent.com/paulmillr/mit/master/README.md)