[Pkg-javascript-commits] [node-async] 261/480: docs: Fix formatting of times example

Jonas Smedegaard js at moszumanska.debian.org
Fri May 2 08:58:32 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 ae6c163d67de1930450236527e00a32341f289db
Author: Girish Ramakrishnan <girish at forwardbias.in>
Date:   Sun Feb 3 12:09:18 2013 -0800

    docs: Fix formatting of times example
---
 README.md | 31 +++++++++++++++++--------------
 1 file changed, 17 insertions(+), 14 deletions(-)

diff --git a/README.md b/README.md
index 6338258..4b22464 100644
--- a/README.md
+++ b/README.md
@@ -1102,20 +1102,23 @@ __Arguments__
 * callback - The function to call n times.
 
 __Example__
-    // Pretend this is some complicated async factory
-    var createUser = function(id, callback) {
-      callback(null, {
-        id: 'user' + id
-      })
-    }
-    // generate 5 users
-    async.times(5, function(n, next){
-        createUser(n, function(err, user) {
-          next(err, user)
-        })
-    }, function(err, users) {
-      // we should now have 5 users
-    });
+
+```js
+// Pretend this is some complicated async factory
+var createUser = function(id, callback) {
+  callback(null, {
+    id: 'user' + id
+  })
+}
+// generate 5 users
+async.times(5, function(n, next){
+    createUser(n, function(err, user) {
+      next(err, user)
+    })
+}, function(err, users) {
+  // we should now have 5 users
+});
+```
 
 <a name="timesSeries" />
 ### timesSeries(n, callback)

-- 
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