Your browser doesn't support the features required by impress.js, so you are presented with a simplified version of this presentation.

For the best experience please use the latest Chrome, Safari or Firefox browser.

and

A presentation of Julian Gimbel and Robert Pinsler

Agenda

1
Node.js in a nutshell
2
npm and modules
3
Pros and cons
4
Getting started
1
Node.js in a nutshell

What's Node.js?

Performance bottleneck

"Please wait..."

Multiple threads

The Node.js way

event-driven + asynchronous, non-blocking I/O

Everything runs in parallel
except your code

Event loop

Callback

				setTimeout(function(){
					console.log("World")
				}, 1000);
			
				console.log('Hello');
			

Hello world!

			var http = require('http');
			
			http.createServer(function (req, res) {
				res.writeHead(200, {'Content-Type': 'text/plain'});
				res.end('Hello World\n');
			}).listen(1337, '127.0.0.1');
			
			console.log('Server running at http://127.0.0.1:1337/');
			

Put this into helloworld.js and run:

> node helloworld.js

2
npm and modules

npm


> npm install

> npm adduser, npm publish


Total packages: 73K+

Downloads last week: 67 mio.

Example: debugging

npm install -g node-inspector

node-debug test.js

3
Pros and cons

Pros

Cons

Usage szenarios

When to use When not to use

Companies using Node.js

4
Getting started

How to create a simple HTTP server

  1. Download node.js
  2. > npm install http-server -g
  3. > cd to/presentation/folder
  4. > http-server
  5. Open localhost:8080

Sources

last visited: 18/05/2014

Image sources

last visited: 18/05/2014