SlideShare ist ein Scribd-Unternehmen logo
1 von 12
Downloaden Sie, um offline zu lesen
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 →

Weitere ähnliche Inhalte

Was ist angesagt?

Andrea Giorgini: Implementazione di un online-shop con Typo3
Andrea Giorgini: Implementazione di un online-shop con Typo3Andrea Giorgini: Implementazione di un online-shop con Typo3
Andrea Giorgini: Implementazione di un online-shop con Typo3
Francesco Fullone
 

Was ist angesagt? (9)

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
 
Andrea Giorgini: Implementazione di un online-shop con Typo3
Andrea Giorgini: Implementazione di un online-shop con Typo3Andrea Giorgini: Implementazione di un online-shop con Typo3
Andrea Giorgini: Implementazione di un online-shop con Typo3
 
Clustering Magento
Clustering MagentoClustering Magento
Clustering Magento
 
StarterTheme Prestashop 1.7
StarterTheme Prestashop 1.7StarterTheme Prestashop 1.7
StarterTheme Prestashop 1.7
 

Andere mochten auch

Introduzione a node: cenni storici ecc
Introduzione a node: cenni storici eccIntroduzione a node: cenni storici ecc
Introduzione a node: cenni storici ecc
Luciano Colosio
 
V. liqviat 2009
V. liqviat 2009V. liqviat 2009
V. liqviat 2009
nera24mx
 
DotNetToscana - Sessione TypeScript
DotNetToscana - Sessione TypeScriptDotNetToscana - Sessione TypeScript
DotNetToscana - Sessione TypeScript
Sinergia Totale
 

Andere mochten auch (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
 

Ähnlich wie node.js everywhere

JBoss Clouds - JBug Roma october 2009
JBoss Clouds -  JBug Roma october 2009JBoss Clouds -  JBug Roma october 2009
JBoss Clouds - JBug Roma october 2009
Sanne Grinovero
 
Sviluppo Web Agile con Castle Monorail
Sviluppo Web Agile con Castle MonorailSviluppo Web Agile con Castle Monorail
Sviluppo Web Agile con Castle Monorail
DotNetMarche
 

Ähnlich wie 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