Introduction to Node.js

26
Patrick Heneise @PatrickHeneise An Introduction { 9. . 2012

description

node.js is the new star in server side programming. Asynchronous, non-blocking and incredibly fast. In the talk we will cover the topics from installation to Hello World. Topics: Installation Introduction to node.js What makes it different? The Server Framework The REPL Hello World Who is Patrick Heneise? Patrick is the Founder & CEO of desentia. He achieved a MSc in Media Technology and BSc in Computer Science in Media. Ever since he has improved social interaction and media with creative and professional technology solutions. He started his first business in 2006 during his studies in the fields of eLearning and web technologies and worked for various companies and universities in eCommerce, telecommunications and research & development

Transcript of Introduction to Node.js

Page 1: Introduction to Node.js

Patrick Heneise@PatrickHeneise

An Introduction {9. . 2012

Page 3: Introduction to Node.js

Server Side Software SystemYet Another Web Framework

Page 5: Introduction to Node.js

Traditional Multithreadingwith Apache

Page 6: Introduction to Node.js

Concurrent Connections

0

10

20

30

40

0 500 1000 1500 2000 2500 3000 3500 4000

Mem

ory

in M

B

http://blog.webfaction.com/2008/12/a-little-holiday-present-10000-reqssec-with-nginx-2/

Apache Nginx

Page 7: Introduction to Node.js

The Pizza Example

Page 8: Introduction to Node.js

Event Loop

Page 9: Introduction to Node.js

JavaScript

Page 10: Introduction to Node.js

[...] if you work on the web, love it or hate it, you’re going to have to work with JavaScript at some point.

Page 11: Introduction to Node.js

Installation

Page 12: Introduction to Node.js

http://nodejs.orgHit INSTALL

Page 13: Introduction to Node.js

brew install node

Page 14: Introduction to Node.js

Hello World!

Page 15: Introduction to Node.js

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/');

Page 16: Introduction to Node.js

Twitter Demo

Page 17: Introduction to Node.js

What is node.js?

Basic theory

Installation

Hello World

Twitter World

npm - the node package manager

Page 18: Introduction to Node.js

http://npm-count.jit.suNPM Count

Page 19: Introduction to Node.js

Number of Modulesnpm vs. gem vs. pip

0

7500

15000

22500

30000

11/09/2012

NPM Ruby Gems pip

Page 20: Introduction to Node.js

Node Deployment

Page 21: Introduction to Node.js

jitsu deploy

http://nodejitsu.com

Page 22: Introduction to Node.js

Helicopters! Flying robots & node.jshttp://nodecopter.com

Page 23: Introduction to Node.js

Extremely fast operations

V8 Runtime

Rapidly growing ecosystem

Super easy deployment, free developer services

JavaScript

Summary

Page 25: Introduction to Node.js

Q&A

Page 26: Introduction to Node.js

Thanks