Skip to content

Commit

Permalink
added empty files for each example
Browse files Browse the repository at this point in the history
  • Loading branch information
scc36 committed Oct 11, 2014
1 parent 59a9e05 commit 196f08d
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,29 @@ nodejs-examples
===============

A series of files containing Node.js examples. An instructional aid for learning Node.js.

Topic list
----------

1. printHello
* Print "Hello World" on your console
2. variables
* arrays and objects
3. functionTest
* Use a function to do something
4. nonBlock
* Demonstrate Node.js asynchronous
5. firstServer
* First Node.js server
6. routesServer
* Handle routes in Node.js
7. serverExpress
* Install a library and make use of it
8. staticFolder
* Setup a website static folder (direct file serving)
9. TCPServer
* Run Node.js as a TCP server
10. socketIO
* Install and run library: socket.io
11. johnny5, cylon.js
* Use Node.js to control an Arduino
2 changes: 2 additions & 0 deletions ex1-printHello.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Outputs "Hello World" to the console
console.log("Hello World");
2 changes: 2 additions & 0 deletions ex10-johnny5.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Outputs "Hello World" to the console
console.log("Hello World");
2 changes: 2 additions & 0 deletions ex2-functionTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Outputs "Hello World" to the console
console.log("Hello World");
18 changes: 18 additions & 0 deletions ex3-nonBlock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Non blocking example
http://webapplog.com/asynchronicity-in-node-js/
var test = function (callback) {
return callback();
console.log('test') //shouldn't be printed
}

var test2 = function(callback){
callback();
console.log('test2') //printed 3rd
}

test(function(){
console.log('callback1') //printed first
test2(function(){
console.log('callback2') //printed 2nd
})
});
2 changes: 2 additions & 0 deletions ex4-firstServer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Outputs "Hello World" to the console
console.log("Hello World");
2 changes: 2 additions & 0 deletions ex5-routesServer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Outputs "Hello World" to the console
console.log("Hello World");
2 changes: 2 additions & 0 deletions ex6-serverExpress.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Outputs "Hello World" to the console
console.log("Hello World");
2 changes: 2 additions & 0 deletions ex7-staticFolder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Outputs "Hello World" to the console
console.log("Hello World");
2 changes: 2 additions & 0 deletions ex8-TCPServer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Outputs "Hello World" to the console
console.log("Hello World");
2 changes: 2 additions & 0 deletions ex9-socketIO.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Outputs "Hello World" to the console
console.log("Hello World");

0 comments on commit 196f08d

Please sign in to comment.