SlideShare a Scribd company logo
Ferrara Linux Day 2011

    The tools of NodeJs
Evented I/O for V8 JavaScript.

Node's goal is to provide an easy way to build scalable
network programs.

Node is similar in design to and influenced by systems like
Ruby's Event Machine or Python's Twisted.

HTTP is a first class protocol in Node. Node's HTTP library has
grown out of the author's experiences developing and working
with web servers.
Event what???

Example:
var http = require('http');

setInterval(function(){
   console.log("Hello world");
}, 2000);

var host = '127.0.0.1';
var port = 12345;

http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello Worldn');
}).listen(port, host);
console.log('Server running at http://' + host + ':' + port + '/');
The first commit was:

"Autore: Ryan <ry@tinyclouds.org>   2009-02-16 01:02:00
Revisione creata da: Ryan <ry@tinyclouds.org> 2009-02-16 01:02:00
Figlio: 61890720c8a22a7f1577327b32a180a2d267d765 (add readme and initial code)
Ramo: master, remotes/origin/autoconf, remotes/origin/back_to_waf, remotes/origin/debugger,
remotes/origin/eventsource, remotes/origin/http_agent, remotes/origin/http_parser_refactor, remotes/origin/
many_listener_warning, remotes/origin/master, remotes/origin/pointer_bindings, remotes/origin/reload,
remotes/origin/v0.2, remotes/origin/v0.4, remotes/origin/writev, remotes/origin/writev2
Segue:
Precede: v0.0.1

  add dependencies"

the project is young!
Very influenced from Ruby :-)
How to install Node?

You can build https://github.com/joyent/node

Or use something like this:
- Nave https://github.com/isaacs/nave
- Nvm https://github.com/creationix/nvm
- N https://github.com/visionmedia/n
All three are bash script that manage different versions on
node in different dirs.
In node there is only one way to manage packages: npm.

There was a big change in the first version, and now npm
manages easily same packages with different versions in
different projects.

The main actor is package.json defined in the CommonJs
specifications.
{
  "author": "gpad",
  "name": "nodelinuxday2011",
  "description": "app example fo LinuxDay 2001",
  "version": "0.0.1",
  "homepage": "https://github.com/gpad/nodelinuxday2011",
  "repository": {
    "type": "git",
    "url": "git://github.com/gpad/nodelinuxday2011.git"
  },
    [...]
}
{
  [...]
   "main": "./server.js",
  "engines": {
    "node": "*"
  },
  "dependencies": {
    "formidable": "~1.0.6"
  },
  "devDependencies": {
    "nodeunit": "~0.5.5",
    "far": "~0.0.7"
  }
}
package.json How it works?

see example ... Cloud9Ide

• Create a file with info e dependencies
• Execute npm install

Install all the dependencies locally so don't conflicts with
others in other projects.

What about devDependencies?
package.json devDependencies How it works?

see example ... Cloud9Ide

npm install --production

install locally only the package necessary to deploy. The
packages listed in devDependencies are not  installed ...

Cloud9Ide on version 1.8.7 works in different way, if you execute npm
install install only "dependencies" if you execute npm install --dev
also install the devDependencies
What about testing? If you look this you will find a long list of
modules for Testing / Spec Frameworks, some examples:

Cucumber — The official JavaScript implementation of the well-
known BDD tool. Runs both on Node.js and browsers.
expresso — TDD framework by the author of JSpec
maryjane — Mock object library inspired by Mockito
node-qunit — QUnit port for nodejs. Very simple API, async testing,
good tested testing framework.
nodeunit — Simple syntax, powerful tools. Based on the assert
module. Available for node.js and the browser!
So we are at the end, how to deploy?

If you use Cloud9ide is very simple (is in beta now I can't :-)) ...,
you can deploy manually with Heroku tools in a very simple
way.

There is a new platform called Nodejitsu with all the tools
available on github.

Others use capistrano with this recipes
Other funny things??

• Jake - Similar to Rake
• Cluster - Node.JS multi-core server manager with plugins support 
• Express - High performance, high class web development for 
  Node.js
• Node-DbDeploy - A data migration tool inspired by dbdeploy
Thank YOU !!!

     Q&A

More Related Content

PDF
An Introduction of Node Package Manager (NPM)
PPTX
Node js introduction
PDF
Non-blocking I/O, Event loops and node.js
PDF
Meetup RomaJS - introduzione interattiva a Node.js - Luca Lanziani - Codemoti...
PDF
PDF
Introduction to NPM and building CLI Tools with Node.js
PPTX
Introduction to Node js
PDF
Helpful pre commit hooks for Python and Django
An Introduction of Node Package Manager (NPM)
Node js introduction
Non-blocking I/O, Event loops and node.js
Meetup RomaJS - introduzione interattiva a Node.js - Luca Lanziani - Codemoti...
Introduction to NPM and building CLI Tools with Node.js
Introduction to Node js
Helpful pre commit hooks for Python and Django

What's hot (20)

PPTX
3 Things Everyone Knows About Node JS That You Don't
PPTX
Start tracking your ruby infrastructure
PDF
Introduction to Node.js: What, why and how?
PDF
Node.js and Ruby
PDF
Multiple django applications on a single server with nginx
PPTX
Java script at backend nodejs
PDF
Philly Tech Week Introduction to NodeJS
PDF
Nodejs presentation
PDF
Построение простого REST сервера на Node.js | Odessa Frontend Code challenge
PDF
Node js实践
PDF
Nodejs in Production
PPTX
Node js for beginners
PDF
Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ...
PPTX
Future of NodeJS
PDF
Webconf nodejs-production-architecture
PDF
NodeJS
PDF
[Js hcm] Deploying node.js with Forever.js and nginx
PDF
Node.js
PDF
Fundamental of Node.JS - Internship Presentation - Week7
PPTX
NodeJS - Server Side JS
3 Things Everyone Knows About Node JS That You Don't
Start tracking your ruby infrastructure
Introduction to Node.js: What, why and how?
Node.js and Ruby
Multiple django applications on a single server with nginx
Java script at backend nodejs
Philly Tech Week Introduction to NodeJS
Nodejs presentation
Построение простого REST сервера на Node.js | Odessa Frontend Code challenge
Node js实践
Nodejs in Production
Node js for beginners
Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ...
Future of NodeJS
Webconf nodejs-production-architecture
NodeJS
[Js hcm] Deploying node.js with Forever.js and nginx
Node.js
Fundamental of Node.JS - Internship Presentation - Week7
NodeJS - Server Side JS
Ad

Viewers also liked (7)

PPTX
Keynote meetup Elixir/Erlang 17 ottobre 2015
PPTX
La mia prima lezione di pozioni
PDF
OOP vs COP
PDF
C++ Actor Model - You’ve Got Mail ...
PPTX
Docker e git lab
PPTX
Async await in C++
PPTX
System integration through queues
Keynote meetup Elixir/Erlang 17 ottobre 2015
La mia prima lezione di pozioni
OOP vs COP
C++ Actor Model - You’ve Got Mail ...
Docker e git lab
Async await in C++
System integration through queues
Ad

Similar to Ferrara Linux Day 2011 (20)

PDF
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
PPTX
Nodejs
PPTX
PPTX
Introduction to Node.js
PPTX
Introduction to node.js By Ahmed Assaf
DOCX
unit 2 of Full stack web development subject
PDF
OSDC.no 2015 introduction to node.js workshop
KEY
node.js: Javascript's in your backend
PPTX
An overview of node.js
PPTX
PDF
introduction to node js kndoendenendjndj
PDF
Node js (runtime environment + js library) platform
PDF
Introduction to Node js for beginners + game project
PDF
Node JS Interview Question PDF By ScholarHat
PPT
Node js beginner
ODP
Introduce about Nodejs - duyetdev.com
PDF
DCEU 18: Docker Containers in a Serverless World
DOCX
Deno vs Node.js: A Comprehensive Comparison.docx
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
Nodejs
Introduction to Node.js
Introduction to node.js By Ahmed Assaf
unit 2 of Full stack web development subject
OSDC.no 2015 introduction to node.js workshop
node.js: Javascript's in your backend
An overview of node.js
introduction to node js kndoendenendjndj
Node js (runtime environment + js library) platform
Introduction to Node js for beginners + game project
Node JS Interview Question PDF By ScholarHat
Node js beginner
Introduce about Nodejs - duyetdev.com
DCEU 18: Docker Containers in a Serverless World
Deno vs Node.js: A Comprehensive Comparison.docx

More from Gianluca Padovani (10)

PDF
A Gentle introduction to microservices
PDF
Beam me up, scotty (PUG Roma)
PPTX
Tdd is not about testing (C++ version)
PPTX
Tdd is not about testing (OOP)
PPTX
DDD loves Actor Model and Actor Model loves Elixir
PDF
Tdd is not about testing
PDF
From a web application to a distributed system
PPTX
Beam way of life
PPTX
Cook your KV
PDF
Beam me up, Scotty
A Gentle introduction to microservices
Beam me up, scotty (PUG Roma)
Tdd is not about testing (C++ version)
Tdd is not about testing (OOP)
DDD loves Actor Model and Actor Model loves Elixir
Tdd is not about testing
From a web application to a distributed system
Beam way of life
Cook your KV
Beam me up, Scotty

Recently uploaded (20)

PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Empathic Computing: Creating Shared Understanding
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
A Presentation on Artificial Intelligence
PDF
Machine learning based COVID-19 study performance prediction
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
DOCX
The AUB Centre for AI in Media Proposal.docx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Approach and Philosophy of On baking technology
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Modernizing your data center with Dell and AMD
PDF
Spectral efficient network and resource selection model in 5G networks
Review of recent advances in non-invasive hemoglobin estimation
Empathic Computing: Creating Shared Understanding
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
A Presentation on Artificial Intelligence
Machine learning based COVID-19 study performance prediction
Dropbox Q2 2025 Financial Results & Investor Presentation
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
The AUB Centre for AI in Media Proposal.docx
“AI and Expert System Decision Support & Business Intelligence Systems”
Encapsulation_ Review paper, used for researhc scholars
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Approach and Philosophy of On baking technology
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Electronic commerce courselecture one. Pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
20250228 LYD VKU AI Blended-Learning.pptx
Modernizing your data center with Dell and AMD
Spectral efficient network and resource selection model in 5G networks

Ferrara Linux Day 2011

  • 1. Ferrara Linux Day 2011 The tools of NodeJs
  • 2. Evented I/O for V8 JavaScript. Node's goal is to provide an easy way to build scalable network programs. Node is similar in design to and influenced by systems like Ruby's Event Machine or Python's Twisted. HTTP is a first class protocol in Node. Node's HTTP library has grown out of the author's experiences developing and working with web servers.
  • 3. Event what??? Example: var http = require('http'); setInterval(function(){ console.log("Hello world"); }, 2000); var host = '127.0.0.1'; var port = 12345; http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello Worldn'); }).listen(port, host); console.log('Server running at http://' + host + ':' + port + '/');
  • 4. The first commit was: "Autore: Ryan <ry@tinyclouds.org> 2009-02-16 01:02:00 Revisione creata da: Ryan <ry@tinyclouds.org> 2009-02-16 01:02:00 Figlio: 61890720c8a22a7f1577327b32a180a2d267d765 (add readme and initial code) Ramo: master, remotes/origin/autoconf, remotes/origin/back_to_waf, remotes/origin/debugger, remotes/origin/eventsource, remotes/origin/http_agent, remotes/origin/http_parser_refactor, remotes/origin/ many_listener_warning, remotes/origin/master, remotes/origin/pointer_bindings, remotes/origin/reload, remotes/origin/v0.2, remotes/origin/v0.4, remotes/origin/writev, remotes/origin/writev2 Segue: Precede: v0.0.1 add dependencies" the project is young!
  • 6. How to install Node? You can build https://github.com/joyent/node Or use something like this: - Nave https://github.com/isaacs/nave - Nvm https://github.com/creationix/nvm - N https://github.com/visionmedia/n All three are bash script that manage different versions on node in different dirs.
  • 7. In node there is only one way to manage packages: npm. There was a big change in the first version, and now npm manages easily same packages with different versions in different projects. The main actor is package.json defined in the CommonJs specifications.
  • 8. { "author": "gpad", "name": "nodelinuxday2011", "description": "app example fo LinuxDay 2001", "version": "0.0.1", "homepage": "https://github.com/gpad/nodelinuxday2011", "repository": { "type": "git", "url": "git://github.com/gpad/nodelinuxday2011.git" },     [...] }
  • 9. {   [...] "main": "./server.js", "engines": { "node": "*" }, "dependencies": { "formidable": "~1.0.6" }, "devDependencies": { "nodeunit": "~0.5.5", "far": "~0.0.7" } }
  • 10. package.json How it works? see example ... Cloud9Ide • Create a file with info e dependencies • Execute npm install Install all the dependencies locally so don't conflicts with others in other projects. What about devDependencies?
  • 11. package.json devDependencies How it works? see example ... Cloud9Ide npm install --production install locally only the package necessary to deploy. The packages listed in devDependencies are not  installed ... Cloud9Ide on version 1.8.7 works in different way, if you execute npm install install only "dependencies" if you execute npm install --dev also install the devDependencies
  • 12. What about testing? If you look this you will find a long list of modules for Testing / Spec Frameworks, some examples: Cucumber — The official JavaScript implementation of the well- known BDD tool. Runs both on Node.js and browsers. expresso — TDD framework by the author of JSpec maryjane — Mock object library inspired by Mockito node-qunit — QUnit port for nodejs. Very simple API, async testing, good tested testing framework. nodeunit — Simple syntax, powerful tools. Based on the assert module. Available for node.js and the browser!
  • 13. So we are at the end, how to deploy? If you use Cloud9ide is very simple (is in beta now I can't :-)) ..., you can deploy manually with Heroku tools in a very simple way. There is a new platform called Nodejitsu with all the tools available on github. Others use capistrano with this recipes
  • 14. Other funny things?? • Jake - Similar to Rake • Cluster - Node.JS multi-core server manager with plugins support  • Express - High performance, high class web development for  Node.js • Node-DbDeploy - A data migration tool inspired by dbdeploy