项目原始demo,不改动
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
Tento repozitář je archivovaný. Můžete prohlížet soubory, klonovat, ale nemůžete nahrávat a vytvářet nové úkoly a požadavky na natažení.

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