SlideShare a Scribd company logo
node.js - javascript ovunque
Roma, 26 ottobre 2013
LinuxDay Roma 2013
Valerio Coltrè → .
←Claudio Mignanti .
Cosa è
node.js è una piattaforma basata su V8, motore
di google che interpreta javascript:
● facile approccio per gli sviluppatori HTML5
● poche risorse richieste
● programmazione single thread
● webserver scriptabile in js
● perfetto per applicazioni
data-intensive
1. http://nodejs.org/
2. http://mashable.com/2011/03/10/node-js/
http://goo.gl/4VuKS6
V8, l’interprete
V8 è l'engine javascript originalmente
sviluppato per Chrome.
1. http://code.google.com/p/v8/
● Molto veloce, profiling avanzato.
● Completamente opensource.
http://goo.gl/4VuKS6
Dove si usa
Ambiti d'uso:
● REST API (JSON)
● NodeCopter
● Coder for Raspberry PI
● Web Developer Tools (Grunt, Bower)
Altri punti a favore:
● community molto aperta e fervente
● performance cpu-bound & data-bound.
● nuove tecnologie (websocket)
http://goo.gl/4VuKS6
javascript
Caratteristiche:
● linguaggio che supporta l'OOP
● interpretato a runtime
● debolmente tipato
http://goo.gl/4VuKS6
Assi nella manica:
● closure
● prototipizzazione
● regex native (senza librerie)
● funzioni anonime native
● simple to learn, hard to master
event loop
Gli interpreti javascript sono single thread
● basato su eventi
○ funzioni in listening sull'evento
● stack di chiamate
● accesso asincrono alle risorse
http://goo.gl/4VuKS6
Specificatamente per nodejs:
● possibilità di accesso sincrono al filesystem
● buffer
● multiprocesso
● ...ed altre nodejs API
npm - node package manager
http://goo.gl/4VuKS6
nodejs è basato su moduli
● AMD-compliant
● ogni modulo é isolato (fn wrap)
Per gestire le (complesse) dipendenze c'è NPM
moduli famosi:
● express Sinatra inspired web development framework
● async Higher-order functions and common patterns for async. code
● grunt The JavaScript Task Runner
● phone-gap allows you to create mobile apps using standardized web APIs
package.json
Gestisce le dipendenze con altri moduli nodejs
● Scaffold veloce con npm init
● non re-inventare la ruota
● moduli utili anche < 100 righe
● one line install
http://goo.gl/4VuKS6
http://package.json.nodejitsu.com/
package.json
http://goo.gl/4VuKS6
Cosa si puo’ fare con nodejs:
Esempio pratico - tail -f
http://goo.gl/4VuKS6
tail.js → chunked.js
● comportamento analogo a tail -f
● versione web
● chunked response (HTTP 1.1)
http://goo.gl/6Ozcc9
API di nodejs utilizzate:
● http - web server
● fs - lettura filesystem
● stream in lettura/scrittura
Esempio pratico - tail -f
http://goo.gl/4VuKS6
http://nodejs.org/api/
http://goo.gl/6Ozcc9
conclusioni
?
← https://github.com/claudyus
https://github.com/mrgamer →
https://github.com/TopCS
http://goo.gl/4VuKS6 →

More Related Content

What's hot

Da JavaScript a TypeScript
Da JavaScript a TypeScriptDa JavaScript a TypeScript
Da JavaScript a TypeScript
Roberto Messora
 
Portofino per Jug Padova
Portofino per Jug PadovaPortofino per Jug Padova
Portofino per Jug Padova
Giampiero Granatella
 
Mageday::2014
Mageday::2014Mageday::2014
Mageday::2014
Alessandro Ronchi
 
All you can store
All you can storeAll you can store
All you can store
Alessandro Avolio
 
Lo sviluppo di Edge Guardian VR - Maurizio Tatafiore - Codemotion Milan 2016
Lo sviluppo di Edge Guardian VR - Maurizio Tatafiore - Codemotion Milan 2016Lo sviluppo di Edge Guardian VR - Maurizio Tatafiore - Codemotion Milan 2016
Lo sviluppo di Edge Guardian VR - Maurizio Tatafiore - Codemotion Milan 2016
Codemotion
 
Windows Azure and Joomla! @ Joomla day 2013
Windows Azure and Joomla! @ Joomla day 2013Windows Azure and Joomla! @ Joomla day 2013
Windows Azure and Joomla! @ Joomla day 2013
Vito Flavio Lorusso
 
Clustering Magento
Clustering MagentoClustering Magento
Clustering Magento
MageSpecialist
 
StarterTheme Prestashop 1.7
StarterTheme Prestashop 1.7StarterTheme Prestashop 1.7
StarterTheme Prestashop 1.7
Bwlab
 

What's hot (8)

Da JavaScript a TypeScript
Da JavaScript a TypeScriptDa JavaScript a TypeScript
Da JavaScript a TypeScript
 
Portofino per Jug Padova
Portofino per Jug PadovaPortofino per Jug Padova
Portofino per Jug Padova
 
Mageday::2014
Mageday::2014Mageday::2014
Mageday::2014
 
All you can store
All you can storeAll you can store
All you can store
 
Lo sviluppo di Edge Guardian VR - Maurizio Tatafiore - Codemotion Milan 2016
Lo sviluppo di Edge Guardian VR - Maurizio Tatafiore - Codemotion Milan 2016Lo sviluppo di Edge Guardian VR - Maurizio Tatafiore - Codemotion Milan 2016
Lo sviluppo di Edge Guardian VR - Maurizio Tatafiore - Codemotion Milan 2016
 
Windows Azure and Joomla! @ Joomla day 2013
Windows Azure and Joomla! @ Joomla day 2013Windows Azure and Joomla! @ Joomla day 2013
Windows Azure and Joomla! @ Joomla day 2013
 
Clustering Magento
Clustering MagentoClustering Magento
Clustering Magento
 
StarterTheme Prestashop 1.7
StarterTheme Prestashop 1.7StarterTheme Prestashop 1.7
StarterTheme Prestashop 1.7
 

Viewers also liked

Apache Cordova: Overview and Introduction
Apache Cordova: Overview and IntroductionApache Cordova: Overview and Introduction
Apache Cordova: Overview and Introduction
Gabriele Falasca
 
Aulas linux
Aulas linuxAulas linux
Aulas linux
Luis Soares
 
Corso base di Tecnologie WEB - Primi passi in javascript
Corso base di Tecnologie WEB - Primi passi in javascriptCorso base di Tecnologie WEB - Primi passi in javascript
Corso base di Tecnologie WEB - Primi passi in javascript
Studiabo
 
Node.js: perche' tutto questo hype?
Node.js: perche' tutto questo hype?Node.js: perche' tutto questo hype?
Node.js: perche' tutto questo hype?
Giancarlo Valente
 
Introduzione a node: cenni storici ecc
Introduzione a node: cenni storici eccIntroduzione a node: cenni storici ecc
Introduzione a node: cenni storici eccLuciano Colosio
 
V. liqviat 2009
V. liqviat 2009V. liqviat 2009
V. liqviat 2009nera24mx
 
node.js e Postgresql
node.js e Postgresqlnode.js e Postgresql
node.js e Postgresql
Lucio Grenzi
 
DotNetToscana - Sessione TypeScript
DotNetToscana - Sessione TypeScriptDotNetToscana - Sessione TypeScript
DotNetToscana - Sessione TypeScriptSinergia Totale
 
Introduzione a jQuery
Introduzione a jQueryIntroduzione a jQuery
Introduzione a jQuery
Emiliano Castellina
 
Introduzione a JavaScript
Introduzione a JavaScriptIntroduzione a JavaScript
Introduzione a JavaScript
Giovanni Buffa
 
Web base-03-js-numeri stringearray
Web base-03-js-numeri stringearrayWeb base-03-js-numeri stringearray
Web base-03-js-numeri stringearray
Studiabo
 
Workshop AngularJs, Cordova, Ionic - Politecnico di Milano
Workshop AngularJs, Cordova, Ionic - Politecnico di MilanoWorkshop AngularJs, Cordova, Ionic - Politecnico di Milano
Workshop AngularJs, Cordova, Ionic - Politecnico di Milano
Gabriele Gaggi
 
Il Web orientato al futuro: Express, Angular e nodeJS
Il Web orientato al futuro: Express, Angular e nodeJS Il Web orientato al futuro: Express, Angular e nodeJS
Il Web orientato al futuro: Express, Angular e nodeJS
Eugenio Minardi
 
Node js: che cos'è e a che cosa serve?
Node js: che cos'è e a che cosa serve?Node js: che cos'è e a che cosa serve?
Node js: che cos'è e a che cosa serve?
Flavius-Florin Harabor
 
Design for Developers: Introduction to Bootstrap 3
Design for Developers: Introduction to Bootstrap 3Design for Developers: Introduction to Bootstrap 3
Design for Developers: Introduction to Bootstrap 3
John Bertucci
 
Node Foundation Membership Overview 20160907
Node Foundation Membership Overview 20160907Node Foundation Membership Overview 20160907
Node Foundation Membership Overview 20160907
NodejsFoundation
 
Introduction to Bootstrap
Introduction to BootstrapIntroduction to Bootstrap
Introduction to Bootstrap
Ron Reiter
 

Viewers also liked (17)

Apache Cordova: Overview and Introduction
Apache Cordova: Overview and IntroductionApache Cordova: Overview and Introduction
Apache Cordova: Overview and Introduction
 
Aulas linux
Aulas linuxAulas linux
Aulas linux
 
Corso base di Tecnologie WEB - Primi passi in javascript
Corso base di Tecnologie WEB - Primi passi in javascriptCorso base di Tecnologie WEB - Primi passi in javascript
Corso base di Tecnologie WEB - Primi passi in javascript
 
Node.js: perche' tutto questo hype?
Node.js: perche' tutto questo hype?Node.js: perche' tutto questo hype?
Node.js: perche' tutto questo hype?
 
Introduzione a node: cenni storici ecc
Introduzione a node: cenni storici eccIntroduzione a node: cenni storici ecc
Introduzione a node: cenni storici ecc
 
V. liqviat 2009
V. liqviat 2009V. liqviat 2009
V. liqviat 2009
 
node.js e Postgresql
node.js e Postgresqlnode.js e Postgresql
node.js e Postgresql
 
DotNetToscana - Sessione TypeScript
DotNetToscana - Sessione TypeScriptDotNetToscana - Sessione TypeScript
DotNetToscana - Sessione TypeScript
 
Introduzione a jQuery
Introduzione a jQueryIntroduzione a jQuery
Introduzione a jQuery
 
Introduzione a JavaScript
Introduzione a JavaScriptIntroduzione a JavaScript
Introduzione a JavaScript
 
Web base-03-js-numeri stringearray
Web base-03-js-numeri stringearrayWeb base-03-js-numeri stringearray
Web base-03-js-numeri stringearray
 
Workshop AngularJs, Cordova, Ionic - Politecnico di Milano
Workshop AngularJs, Cordova, Ionic - Politecnico di MilanoWorkshop AngularJs, Cordova, Ionic - Politecnico di Milano
Workshop AngularJs, Cordova, Ionic - Politecnico di Milano
 
Il Web orientato al futuro: Express, Angular e nodeJS
Il Web orientato al futuro: Express, Angular e nodeJS Il Web orientato al futuro: Express, Angular e nodeJS
Il Web orientato al futuro: Express, Angular e nodeJS
 
Node js: che cos'è e a che cosa serve?
Node js: che cos'è e a che cosa serve?Node js: che cos'è e a che cosa serve?
Node js: che cos'è e a che cosa serve?
 
Design for Developers: Introduction to Bootstrap 3
Design for Developers: Introduction to Bootstrap 3Design for Developers: Introduction to Bootstrap 3
Design for Developers: Introduction to Bootstrap 3
 
Node Foundation Membership Overview 20160907
Node Foundation Membership Overview 20160907Node Foundation Membership Overview 20160907
Node Foundation Membership Overview 20160907
 
Introduction to Bootstrap
Introduction to BootstrapIntroduction to Bootstrap
Introduction to Bootstrap
 

Similar to node.js everywhere

Node.js - Server Side Javascript
Node.js - Server Side JavascriptNode.js - Server Side Javascript
Node.js - Server Side Javascript
Matteo Napolitano
 
October 2009 - JBoss Cloud
October 2009 - JBoss CloudOctober 2009 - JBoss Cloud
October 2009 - JBoss Cloud
JBug Italy
 
JBoss Clouds - JBug Roma october 2009
JBoss Clouds -  JBug Roma october 2009JBoss Clouds -  JBug Roma october 2009
JBoss Clouds - JBug Roma october 2009Sanne Grinovero
 
phpday 2006 - SEA case study
phpday 2006 - SEA case studyphpday 2006 - SEA case study
phpday 2006 - SEA case study
Gaetano Giunta
 
Android: Introduzione all'architettura, alla programmazione e alla sicurezza
Android: Introduzione all'architettura, alla programmazione e alla sicurezzaAndroid: Introduzione all'architettura, alla programmazione e alla sicurezza
Android: Introduzione all'architettura, alla programmazione e alla sicurezza
jekil
 
Framework per la realizzazione di ria
Framework per la realizzazione di riaFramework per la realizzazione di ria
Framework per la realizzazione di ria
Lorenzo Bortolotto
 
Rich Internet Application
Rich Internet ApplicationRich Internet Application
Rich Internet Application
Marcello Teodori
 
Link. php [santi caltabiano]
  Link. php [santi caltabiano]  Link. php [santi caltabiano]
Link. php [santi caltabiano]
santi caltabiano
 
Sviluppo Web Agile con Castle Monorail
Sviluppo Web Agile con Castle MonorailSviluppo Web Agile con Castle Monorail
Sviluppo Web Agile con Castle MonorailDotNetMarche
 
Open Day June 17th Creare componenti AngularJS riutilizzabili tra applicazioni
Open Day June 17th Creare componenti AngularJS riutilizzabili tra applicazioniOpen Day June 17th Creare componenti AngularJS riutilizzabili tra applicazioni
Open Day June 17th Creare componenti AngularJS riutilizzabili tra applicazioni
Vendini-Italy
 
Zend Framework 2
Zend Framework 2Zend Framework 2
Zend Framework 2
Enrico Zimuel
 
Framework software e Zend Framework
Framework software e Zend FrameworkFramework software e Zend Framework
Framework software e Zend Framework
Enrico Zimuel
 
GWT Development for Handheld Devices
GWT Development for Handheld DevicesGWT Development for Handheld Devices
GWT Development for Handheld Devices
GWTcon
 
Drupal 10: un framework PHP di sviluppo Cloud Native moderno
Drupal 10: un framework PHP di sviluppo Cloud Native modernoDrupal 10: un framework PHP di sviluppo Cloud Native moderno
Drupal 10: un framework PHP di sviluppo Cloud Native moderno
sparkfabrik
 
Sviluppare Azure Web Apps
Sviluppare Azure Web AppsSviluppare Azure Web Apps
Sviluppare Azure Web Apps
Andrea Dottor
 
I linguaggi del web - seconda edizione (3° giornata)
I linguaggi del web - seconda edizione (3° giornata)I linguaggi del web - seconda edizione (3° giornata)
I linguaggi del web - seconda edizione (3° giornata)
Diego La Monica
 
.NET Core, ASP.NET Core e Linux per il Mobile
.NET Core, ASP.NET Core e Linux per il Mobile.NET Core, ASP.NET Core e Linux per il Mobile
.NET Core, ASP.NET Core e Linux per il Mobile
Pietro Libro
 
ASP.NET Core Services e Linux per il Mobile - Pietro Libro - Codemotion Rome...
ASP.NET Core Services e Linux per il Mobile  - Pietro Libro - Codemotion Rome...ASP.NET Core Services e Linux per il Mobile  - Pietro Libro - Codemotion Rome...
ASP.NET Core Services e Linux per il Mobile - Pietro Libro - Codemotion Rome...
Codemotion
 
2014.04.04 Sviluppare applicazioni web (completamente) on line con Visual Stu...
2014.04.04 Sviluppare applicazioni web (completamente) on line con Visual Stu...2014.04.04 Sviluppare applicazioni web (completamente) on line con Visual Stu...
2014.04.04 Sviluppare applicazioni web (completamente) on line con Visual Stu...
Marco Parenzan
 

Similar to node.js everywhere (20)

Node.js - Server Side Javascript
Node.js - Server Side JavascriptNode.js - Server Side Javascript
Node.js - Server Side Javascript
 
October 2009 - JBoss Cloud
October 2009 - JBoss CloudOctober 2009 - JBoss Cloud
October 2009 - JBoss Cloud
 
JBoss Clouds - JBug Roma october 2009
JBoss Clouds -  JBug Roma october 2009JBoss Clouds -  JBug Roma october 2009
JBoss Clouds - JBug Roma october 2009
 
App Engine + Python
App Engine + PythonApp Engine + Python
App Engine + Python
 
phpday 2006 - SEA case study
phpday 2006 - SEA case studyphpday 2006 - SEA case study
phpday 2006 - SEA case study
 
Android: Introduzione all'architettura, alla programmazione e alla sicurezza
Android: Introduzione all'architettura, alla programmazione e alla sicurezzaAndroid: Introduzione all'architettura, alla programmazione e alla sicurezza
Android: Introduzione all'architettura, alla programmazione e alla sicurezza
 
Framework per la realizzazione di ria
Framework per la realizzazione di riaFramework per la realizzazione di ria
Framework per la realizzazione di ria
 
Rich Internet Application
Rich Internet ApplicationRich Internet Application
Rich Internet Application
 
Link. php [santi caltabiano]
  Link. php [santi caltabiano]  Link. php [santi caltabiano]
Link. php [santi caltabiano]
 
Sviluppo Web Agile con Castle Monorail
Sviluppo Web Agile con Castle MonorailSviluppo Web Agile con Castle Monorail
Sviluppo Web Agile con Castle Monorail
 
Open Day June 17th Creare componenti AngularJS riutilizzabili tra applicazioni
Open Day June 17th Creare componenti AngularJS riutilizzabili tra applicazioniOpen Day June 17th Creare componenti AngularJS riutilizzabili tra applicazioni
Open Day June 17th Creare componenti AngularJS riutilizzabili tra applicazioni
 
Zend Framework 2
Zend Framework 2Zend Framework 2
Zend Framework 2
 
Framework software e Zend Framework
Framework software e Zend FrameworkFramework software e Zend Framework
Framework software e Zend Framework
 
GWT Development for Handheld Devices
GWT Development for Handheld DevicesGWT Development for Handheld Devices
GWT Development for Handheld Devices
 
Drupal 10: un framework PHP di sviluppo Cloud Native moderno
Drupal 10: un framework PHP di sviluppo Cloud Native modernoDrupal 10: un framework PHP di sviluppo Cloud Native moderno
Drupal 10: un framework PHP di sviluppo Cloud Native moderno
 
Sviluppare Azure Web Apps
Sviluppare Azure Web AppsSviluppare Azure Web Apps
Sviluppare Azure Web Apps
 
I linguaggi del web - seconda edizione (3° giornata)
I linguaggi del web - seconda edizione (3° giornata)I linguaggi del web - seconda edizione (3° giornata)
I linguaggi del web - seconda edizione (3° giornata)
 
.NET Core, ASP.NET Core e Linux per il Mobile
.NET Core, ASP.NET Core e Linux per il Mobile.NET Core, ASP.NET Core e Linux per il Mobile
.NET Core, ASP.NET Core e Linux per il Mobile
 
ASP.NET Core Services e Linux per il Mobile - Pietro Libro - Codemotion Rome...
ASP.NET Core Services e Linux per il Mobile  - Pietro Libro - Codemotion Rome...ASP.NET Core Services e Linux per il Mobile  - Pietro Libro - Codemotion Rome...
ASP.NET Core Services e Linux per il Mobile - Pietro Libro - Codemotion Rome...
 
2014.04.04 Sviluppare applicazioni web (completamente) on line con Visual Stu...
2014.04.04 Sviluppare applicazioni web (completamente) on line con Visual Stu...2014.04.04 Sviluppare applicazioni web (completamente) on line con Visual Stu...
2014.04.04 Sviluppare applicazioni web (completamente) on line con Visual Stu...
 

node.js everywhere

  • 1. node.js - javascript ovunque Roma, 26 ottobre 2013 LinuxDay Roma 2013 Valerio Coltrè → . ←Claudio Mignanti .
  • 2. Cosa è node.js è una piattaforma basata su V8, motore di google che interpreta javascript: ● facile approccio per gli sviluppatori HTML5 ● poche risorse richieste ● programmazione single thread ● webserver scriptabile in js ● perfetto per applicazioni data-intensive 1. http://nodejs.org/ 2. http://mashable.com/2011/03/10/node-js/ http://goo.gl/4VuKS6
  • 3. V8, l’interprete V8 è l'engine javascript originalmente sviluppato per Chrome. 1. http://code.google.com/p/v8/ ● Molto veloce, profiling avanzato. ● Completamente opensource. http://goo.gl/4VuKS6
  • 4. Dove si usa Ambiti d'uso: ● REST API (JSON) ● NodeCopter ● Coder for Raspberry PI ● Web Developer Tools (Grunt, Bower) Altri punti a favore: ● community molto aperta e fervente ● performance cpu-bound & data-bound. ● nuove tecnologie (websocket) http://goo.gl/4VuKS6
  • 5. javascript Caratteristiche: ● linguaggio che supporta l'OOP ● interpretato a runtime ● debolmente tipato http://goo.gl/4VuKS6 Assi nella manica: ● closure ● prototipizzazione ● regex native (senza librerie) ● funzioni anonime native ● simple to learn, hard to master
  • 6. event loop Gli interpreti javascript sono single thread ● basato su eventi ○ funzioni in listening sull'evento ● stack di chiamate ● accesso asincrono alle risorse http://goo.gl/4VuKS6 Specificatamente per nodejs: ● possibilità di accesso sincrono al filesystem ● buffer ● multiprocesso ● ...ed altre nodejs API
  • 7. npm - node package manager http://goo.gl/4VuKS6 nodejs è basato su moduli ● AMD-compliant ● ogni modulo é isolato (fn wrap) Per gestire le (complesse) dipendenze c'è NPM moduli famosi: ● express Sinatra inspired web development framework ● async Higher-order functions and common patterns for async. code ● grunt The JavaScript Task Runner ● phone-gap allows you to create mobile apps using standardized web APIs
  • 8. package.json Gestisce le dipendenze con altri moduli nodejs ● Scaffold veloce con npm init ● non re-inventare la ruota ● moduli utili anche < 100 righe ● one line install http://goo.gl/4VuKS6 http://package.json.nodejitsu.com/
  • 10. Cosa si puo’ fare con nodejs: Esempio pratico - tail -f http://goo.gl/4VuKS6 tail.js → chunked.js ● comportamento analogo a tail -f ● versione web ● chunked response (HTTP 1.1) http://goo.gl/6Ozcc9
  • 11. API di nodejs utilizzate: ● http - web server ● fs - lettura filesystem ● stream in lettura/scrittura Esempio pratico - tail -f http://goo.gl/4VuKS6 http://nodejs.org/api/ http://goo.gl/6Ozcc9