Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

first commit

  • Loading branch information...
commit 2e86fcae53652901d8d745c5080eb142a78c8efe 0 parents
@bu authored
1  .gitignore
@@ -0,0 +1 @@
+node_modules
7 async.waterfall.js
@@ -0,0 +1,7 @@
+var async = require("async");
+
+async.waterfall([
+
+], function (err, result) {
+ // result now equals 'done'
+});
17 callback.js
@@ -0,0 +1,17 @@
+
+loadLanguage(function(err, lang) {
+ if(err) {
+ console.log(err);
+ }
+
+ loadLanguage(function(err, lang) {
+ if(err) {
+ console.log(err);
+ }
+
+ loadLanguage(function(err, lang) {
+ if(err) {
+ console.log(err);
+ }
+
+});
37 q.promise.js
@@ -0,0 +1,37 @@
+var q = require("q");
+var fs = require("fs");
+
+q.fcall(cleanupRoom)
+ .then(buySomthing)
+ .then(payTheBill, function(err) {
+ console.log(err);
+ })
+ .then(function() {
+ console.log("Yeah!");
+ });
+
+function cleanupRoom() {
+ console.log("1");
+ return true;
+}
+
+function buySomthing(cleanup_Result) {
+ console.log(cleanup_Result);
+
+ var deferred = q.defer();
+
+ fs.writeFile("bu.txt", "bu", function(err) {
+ if(err) {
+ return deferred.reject(err);
+ }
+ console.log("2");
+ deferred.resolve(true);
+ });
+
+ return deferred.promise;
+}
+
+function payTheBill() {
+ console.log("3");
+ return true;
+}
7 test
@@ -0,0 +1,7 @@
+// this file will assert something
+// we use this file as unit testing
+
+module.exports = function() {
+
+
+};
0  test_module.js
No changes.
Please sign in to comment.
Something went wrong with that request. Please try again.