Introduction to Node.js
-
Upload
itnig -
Category
Technology
-
view
819 -
download
3
description
Transcript of Introduction to Node.js
Patrick Heneise@PatrickHeneise
An Introduction {9. . 2012
What is node.js?
“Node.js is a server side software system designed for writing scalable Internet applications, notably web servers. Programs are written on the server side in JavaScript, using event-driven, asynchronous I/O to minimize overhead and maximize scalability.” - http://en.wikipedia.org/wiki/Nodejs
Server Side Software SystemYet Another Web Framework
event-driven, asynchronous I/O for V8
Traditional Multithreadingwith Apache
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
The Pizza Example
Event Loop
JavaScript
[...] if you work on the web, love it or hate it, you’re going to have to work with JavaScript at some point.
Installation
brew install node
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/');
Twitter Demo
What is node.js?
Basic theory
Installation
Hello World
Twitter World
npm - the node package manager
Number of Modulesnpm vs. gem vs. pip
0
7500
15000
22500
30000
11/09/2012
NPM Ruby Gems pip
Node Deployment
Helicopters! Flying robots & node.jshttp://nodecopter.com
Extremely fast operations
V8 Runtime
Rapidly growing ecosystem
Super easy deployment, free developer services
JavaScript
Summary
More...
http://nodemanual.org/0.8.14/nodejs_dev_guide/index.html
http://nodestack.org/videos
http://net.tutsplus.com/tutorials/javascript-ajax/this-time-youll-learn-node-js
http://www.youtube.com/user/lxjs2012
http://www.meetup.com/nodejs-bcn/
https://github.com/PatrickHeneise/nodejsbcn-bcnstartupmap
Q&A
Thanks