source: trip-planner-front/node_modules/async-each/README.md@ 6fe77af

Last change on this file since 6fe77af was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.0 KB
Line 
1# async-each
2
3No-bullshit, ultra-simple, 35-lines-of-code async parallel forEach function for JavaScript.
4
5We don't need junky 30K async libs. Really.
6
7For 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
13## Usage
14
15* `each(array, iterator, callback);` — `Array`, `Function`, `(optional) Function`
16* `iterator(item, next)` receives current item and a callback that will mark the item as done. `next` callback receives optional `error, transformedItem` arguments.
17* `callback(error, transformedArray)` optionally receives first error and transformed result `Array`.
18
19```javascript
20var each = require('async-each');
21each(['a.js', 'b.js', 'c.js'], fs.readFile, function(error, contents) {
22 if (error) console.error(error);
23 console.log('Contents for a, b and c:', contents);
24});
25
26// Alternatively in browser:
27asyncEach(list, fn, callback);
28```
29
30## License
31
32The MIT License (MIT)
33
34Copyright (c) 2016 Paul Miller [(paulmillr.com)](http://paulmillr.com)
35
36Permission is hereby granted, free of charge, to any person obtaining a copy
37of this software and associated documentation files (the “Software”), to deal
38in the Software without restriction, including without limitation the rights
39to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
40copies of the Software, and to permit persons to whom the Software is
41furnished to do so, subject to the following conditions:
42
43The above copyright notice and this permission notice shall be included in
44all copies or substantial portions of the Software.
45
46THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
47IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
48FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
49AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
50LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
51OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
52THE SOFTWARE.
Note: See TracBrowser for help on using the repository browser.