[Pkg-javascript-commits] [node-async] 17/480: added docs to README.md for forEach and forEachSeries

Jonas Smedegaard js at moszumanska.debian.org
Fri May 2 08:58:08 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository node-async.

commit 502d47aa8c1293c151291d519b0ed1530ee359c6
Author: Caolan McMahon <caolan at caolanmcmahon.com>
Date:   Thu May 27 23:30:30 2010 +0100

    added docs to README.md for forEach and forEachSeries
---
 README.md | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index e868bf1..bee2cb1 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,30 @@ provide some higher-order functions that work when writing async code.
 
 ## Collections
 
-Not yet documented.
+Not yet fully documented.
+
+### forEach(arr, iterator, callback)
+
+Iterates over an array, applying an iterator function to each, in parallel.
+The iterator is called with an item from the list and a callback for when it
+has finished. If the iterator passes an error to this callback, the main
+callback for the forEach function is immediately called with the error.
+
+Note, that since this function applies the iterator to each item in parallel
+there is no guarantee that the iterator functions will complete in order.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* iterator(item, callback) - A function to apply to each item in the array.
+  The iterator is passed a callback which is must call once it has completed.
+* callback(err) - A callback which is called after all the iterator functions
+  have finished, or an error has occurred.
+
+### forEachSeries(arr, iterator, callback)
+
+The same as forEach only the iterators are applied in series. The next
+iterator is only called once the current one has completed processing.
 
 
 ## Flow Control

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-async.git



More information about the Pkg-javascript-commits mailing list