Comparing version 0.0.9 to 0.0.10
{ | ||
"name": "async-you", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "Learn async via a set of self-guided workshops.", | ||
@@ -5,0 +5,0 @@ "author": "Bulkan Evcimen <bulkan@gmail.com> (https://github.com/bulkan)", |
@@ -10,3 +10,3 @@ Write a program that will receive two command line arguments containing | ||
Do this five times with each the `user_id` property being incremented starting | ||
Do this five times with each of the `user_id` property being incremented starting | ||
at 1. | ||
@@ -18,5 +18,7 @@ | ||
and console.log the response body. | ||
and console.log the response body for the GET request. | ||
{italic}HINTS{/italic}: In this problem, you will need to co-ordinate a few async operations. | ||
{italic}HINTS{/italic}: use async.times and http.request | ||
Use async.series for this and pass in an Object. One of the task functions will need to use async.times | ||
to send POST requests using http.request. The other will then do the GET request. |
@@ -8,4 +8,4 @@ var http = require('http') | ||
async.series([ | ||
function(done){ | ||
async.series({ | ||
post: function(done){ | ||
function _addUser(user_id, cb){ | ||
@@ -29,3 +29,3 @@ | ||
cb(); | ||
}); | ||
}); | ||
}); | ||
@@ -49,3 +49,3 @@ | ||
function(done){ | ||
get: function(done){ | ||
http.get(url + '/users', function(res){ | ||
@@ -63,5 +63,5 @@ var body = ""; | ||
], function(err, result){ | ||
}, function(err, result){ | ||
if (err) return console.log(err); | ||
console.log(result); | ||
console.log(result.get); | ||
}); |
@@ -17,3 +17,3 @@ # async-you | ||
2. Run `sudo npm install async-you -g` | ||
3. Run `async_you` | ||
3. Run `async-you` | ||
@@ -24,7 +24,7 @@ ## Usage | ||
Once the workshop is installed, run `async_you` to print a menu | ||
Once the workshop is installed, run `async-you` to print a menu | ||
where you can select a problem to work on. | ||
``` | ||
$ async_you | ||
$ async-you | ||
``` | ||
@@ -46,3 +46,3 @@ | ||
``` | ||
$ async_you run mysolution.js | ||
$ async-you run mysolution.js | ||
``` | ||
@@ -56,3 +56,3 @@ | ||
``` | ||
$ async_you verify mysolution.js | ||
$ async-you verify mysolution.js | ||
``` | ||
@@ -59,0 +59,0 @@ |
19067