SlideShare une entreprise Scribd logo
1  sur  42
Server-Side JavaScript
   Developement
       Node.JS Quick Tour

      q3boy <q3boy1@gmail.com>
        from http://cnodejs.org/
Server-Side JavaScript
    Development
Aptana Jaxer (SpiderMonkey)




      Helma (Rhino)
•
•
Revelutions in 2009
•   CommonJS (ServerJS), by Dangoor

•   JSConf, by Chris Williams & Iterative Designs

•   Node, by Ray Dahl.
Node's goal is to provide an easy
way to build scalable network
programs

                   -- nodejs.org
Ray Dahl
• 1/5/2009 Ryah Dahl
• 2/15/2009
• 5/31/2009
• ......
• 11/16/2010 v0.3.1
•        wiki   600 module

•   20

•
• libev (event loop)
• libeio (nonblocked posix, thread pool)
• v8 (javascript engine by google)
•
•
•
io




io
io




io
-

•
•
•
-

•   cpu


•
- Web Worker
• AMD Opteron 2200 , 4G RAM
• socket client 20,000+ qps
• socket server 17,000 qps
• http server 4,400 qps
•            30~40m
• see more. <http://nodejs.kongwu.net/blog/?
  p=8>
• SSL
• Windows
• 1G        (by v8)
• Web
•
• Spider
Digg in the node
$ git clone git://github.com/ry/node.git
$ cd node
$ ./configure --prefix=$HOME/node
$ make install
Hello World!




Familiar & Simple
$ node singleThread.js
1
2
3
4
CommonJS




$ node CommonJS.js
foobar
io




$ node nonblocking.js
Reading my.txt ...
my.txt
Here is contents in "my.txt".
HTTP
TCP
      $ node tcpServer.js &
      $ telnet locahost 1234
      Welcome!
      > Node is so Cooool.
      Node is so Cooool.
      >
$ node watchFile.js &
$ sleep 3; touch my.txt
the current mtime is: 1292594780000
the previous mtime was: 1292594752000
$ node childProcess.js
hello
world
String vs Buffer

         String

•
• node               v8 String    ,
    socket              memcopy

•            v8 gc
String vs Buffer




    With String
String vs Buffer




    With Buffer
With String
With Buffer
Want to see more?
• PHP: pear
• Python: PyPI, setuptools
• Ruby: Gems

• Node:
$ cat >>~/.npmrc <<NPMRC
root = ~/.node_libraries
binroot = ~/bin
manroot = ~/share/man
NPMRC
$ curl http://npmjs.org/install.sh | sh


$ npm ls
$ npm install package_name
$ npm update
IDE base on node




 http://www.cloud9ide.com/
Links
• http://www.commonjs.org/
• http://nodejs.org/
• http://howtonode.org/
• https://github.com/ry/node/wiki
• https://github.com/ry/node/wiki/modules
• https://github.com/isaacs/npm
Node in Taobao
•   UED
    •   nodejs-kissy by         <bachi@taobao.com>
•   EDP
    •   http://cnodejs.org/ (                     node    , coming
        soon)
    •   node-reverse-proxy (                  ,           , coming
        soon)
    •   node-myfox (mysql                2011 Q1)
    •   node-glider (                                2011 Q2)
    •   node-kvproxy (key-value                   2011 Q2)
Node js quick-tour_v2

Contenu connexe

Tendances

Node.js - The New, New Hotness
Node.js - The New, New HotnessNode.js - The New, New Hotness
Node.js - The New, New HotnessDaniel Shaw
 
Meetup RomaJS - introduzione interattiva a Node.js - Luca Lanziani - Codemoti...
Meetup RomaJS - introduzione interattiva a Node.js - Luca Lanziani - Codemoti...Meetup RomaJS - introduzione interattiva a Node.js - Luca Lanziani - Codemoti...
Meetup RomaJS - introduzione interattiva a Node.js - Luca Lanziani - Codemoti...Codemotion
 
Complete MVC on NodeJS
Complete MVC on NodeJSComplete MVC on NodeJS
Complete MVC on NodeJSHüseyin BABAL
 
Node.js - A practical introduction (v2)
Node.js  - A practical introduction (v2)Node.js  - A practical introduction (v2)
Node.js - A practical introduction (v2)Felix Geisendörfer
 
Presentation of JSConf.eu
Presentation of JSConf.euPresentation of JSConf.eu
Presentation of JSConf.euFredrik Wendt
 
Introduction to node.js aka NodeJS
Introduction to node.js aka NodeJSIntroduction to node.js aka NodeJS
Introduction to node.js aka NodeJSJITENDRA KUMAR PATEL
 
Introduction to node.js GDD
Introduction to node.js GDDIntroduction to node.js GDD
Introduction to node.js GDDSudar Muthu
 
Java script at backend nodejs
Java script at backend   nodejsJava script at backend   nodejs
Java script at backend nodejsAmit Thakkar
 
Server side scripting smack down - Node.js vs PHP
Server side scripting smack down - Node.js vs PHPServer side scripting smack down - Node.js vs PHP
Server side scripting smack down - Node.js vs PHPMarc Gear
 
JavaScript is the new black - Why Node.js is going to rock your world - Web 2...
JavaScript is the new black - Why Node.js is going to rock your world - Web 2...JavaScript is the new black - Why Node.js is going to rock your world - Web 2...
JavaScript is the new black - Why Node.js is going to rock your world - Web 2...Tom Croucher
 
Dirty - How simple is your database?
Dirty - How simple is your database?Dirty - How simple is your database?
Dirty - How simple is your database?Felix Geisendörfer
 
NodeJS Concurrency
NodeJS ConcurrencyNodeJS Concurrency
NodeJS Concurrencypgriess
 
Node.js and How JavaScript is Changing Server Programming
Node.js and How JavaScript is Changing Server Programming  Node.js and How JavaScript is Changing Server Programming
Node.js and How JavaScript is Changing Server Programming Tom Croucher
 
Building GUI App with Electron and Lisp
Building GUI App with Electron and LispBuilding GUI App with Electron and Lisp
Building GUI App with Electron and Lispfukamachi
 

Tendances (19)

Node.js - The New, New Hotness
Node.js - The New, New HotnessNode.js - The New, New Hotness
Node.js - The New, New Hotness
 
Meetup RomaJS - introduzione interattiva a Node.js - Luca Lanziani - Codemoti...
Meetup RomaJS - introduzione interattiva a Node.js - Luca Lanziani - Codemoti...Meetup RomaJS - introduzione interattiva a Node.js - Luca Lanziani - Codemoti...
Meetup RomaJS - introduzione interattiva a Node.js - Luca Lanziani - Codemoti...
 
Complete MVC on NodeJS
Complete MVC on NodeJSComplete MVC on NodeJS
Complete MVC on NodeJS
 
Future of NodeJS
Future of NodeJSFuture of NodeJS
Future of NodeJS
 
Node.js - A practical introduction (v2)
Node.js  - A practical introduction (v2)Node.js  - A practical introduction (v2)
Node.js - A practical introduction (v2)
 
Presentation of JSConf.eu
Presentation of JSConf.euPresentation of JSConf.eu
Presentation of JSConf.eu
 
Node.js - A Quick Tour II
Node.js - A Quick Tour IINode.js - A Quick Tour II
Node.js - A Quick Tour II
 
Introduction to node.js aka NodeJS
Introduction to node.js aka NodeJSIntroduction to node.js aka NodeJS
Introduction to node.js aka NodeJS
 
Node.js - As a networking tool
Node.js - As a networking toolNode.js - As a networking tool
Node.js - As a networking tool
 
Introduction to node.js GDD
Introduction to node.js GDDIntroduction to node.js GDD
Introduction to node.js GDD
 
Java script at backend nodejs
Java script at backend   nodejsJava script at backend   nodejs
Java script at backend nodejs
 
Server side scripting smack down - Node.js vs PHP
Server side scripting smack down - Node.js vs PHPServer side scripting smack down - Node.js vs PHP
Server side scripting smack down - Node.js vs PHP
 
JavaScript is the new black - Why Node.js is going to rock your world - Web 2...
JavaScript is the new black - Why Node.js is going to rock your world - Web 2...JavaScript is the new black - Why Node.js is going to rock your world - Web 2...
JavaScript is the new black - Why Node.js is going to rock your world - Web 2...
 
Nodejs - A-quick-tour-v3
Nodejs - A-quick-tour-v3Nodejs - A-quick-tour-v3
Nodejs - A-quick-tour-v3
 
Dirty - How simple is your database?
Dirty - How simple is your database?Dirty - How simple is your database?
Dirty - How simple is your database?
 
NodeJS Concurrency
NodeJS ConcurrencyNodeJS Concurrency
NodeJS Concurrency
 
Node.js and How JavaScript is Changing Server Programming
Node.js and How JavaScript is Changing Server Programming  Node.js and How JavaScript is Changing Server Programming
Node.js and How JavaScript is Changing Server Programming
 
Building GUI App with Electron and Lisp
Building GUI App with Electron and LispBuilding GUI App with Electron and Lisp
Building GUI App with Electron and Lisp
 
Nodejs - A quick tour (v4)
Nodejs - A quick tour (v4)Nodejs - A quick tour (v4)
Nodejs - A quick tour (v4)
 

En vedette

調和道 『藤田霊斎 丹田呼吸法』 Zen Breathing
調和道 『藤田霊斎 丹田呼吸法』 Zen Breathing調和道 『藤田霊斎 丹田呼吸法』 Zen Breathing
調和道 『藤田霊斎 丹田呼吸法』 Zen Breathing博行 門眞
 
2013 hub kaho university college onderwijsdag lezing ttt 5 rolmodel v2
2013 hub kaho university college onderwijsdag lezing ttt 5 rolmodel v22013 hub kaho university college onderwijsdag lezing ttt 5 rolmodel v2
2013 hub kaho university college onderwijsdag lezing ttt 5 rolmodel v2Pascal Van Loo
 
Sealy Publications
Sealy   PublicationsSealy   Publications
Sealy Publicationsjemels
 
Engraving Services Australia
Engraving Services AustraliaEngraving Services Australia
Engraving Services Australiaengravingservices
 
Werken aan waardengedreven netwerkorganisatie bij AgSO Pascal Van Loo, Pasas ...
Werken aan waardengedreven netwerkorganisatie bij AgSO Pascal Van Loo, Pasas ...Werken aan waardengedreven netwerkorganisatie bij AgSO Pascal Van Loo, Pasas ...
Werken aan waardengedreven netwerkorganisatie bij AgSO Pascal Van Loo, Pasas ...Pascal Van Loo
 
Pasas Case Complex Groupmediation
Pasas Case Complex GroupmediationPasas Case Complex Groupmediation
Pasas Case Complex GroupmediationPascal Van Loo
 
2011 TTT VOV The Training Transition Lancering
2011 TTT VOV The Training Transition Lancering2011 TTT VOV The Training Transition Lancering
2011 TTT VOV The Training Transition LanceringPascal Van Loo
 
Pasas Mediation op vov beurs 2013
Pasas Mediation op vov beurs 2013Pasas Mediation op vov beurs 2013
Pasas Mediation op vov beurs 2013Pascal Van Loo
 
Presentatie Pascal Van Loo via SD WOrx voor kbc adviesvaardigheden v5
Presentatie Pascal Van Loo via SD WOrx voor kbc adviesvaardigheden v5Presentatie Pascal Van Loo via SD WOrx voor kbc adviesvaardigheden v5
Presentatie Pascal Van Loo via SD WOrx voor kbc adviesvaardigheden v5Pascal Van Loo
 
Sealy Publications
Sealy   PublicationsSealy   Publications
Sealy Publicationsjemels
 
Vergadertechnieken essentie in 3 slides en 6 tips op #hautekiet radio 1 door ...
Vergadertechnieken essentie in 3 slides en 6 tips op #hautekiet radio 1 door ...Vergadertechnieken essentie in 3 slides en 6 tips op #hautekiet radio 1 door ...
Vergadertechnieken essentie in 3 slides en 6 tips op #hautekiet radio 1 door ...Pascal Van Loo
 
20141124 presentation innovative knowledge sharing put into practice in 3 cas...
20141124 presentation innovative knowledge sharing put into practice in 3 cas...20141124 presentation innovative knowledge sharing put into practice in 3 cas...
20141124 presentation innovative knowledge sharing put into practice in 3 cas...Pascal Van Loo
 
20161021 pascal van loo ervaringsleren bij organisatieverandering v publicatie
20161021 pascal van loo ervaringsleren bij organisatieverandering v publicatie20161021 pascal van loo ervaringsleren bij organisatieverandering v publicatie
20161021 pascal van loo ervaringsleren bij organisatieverandering v publicatiePascal Van Loo
 
Kalandorok - március - Burgenland
Kalandorok -  március - BurgenlandKalandorok -  március - Burgenland
Kalandorok - március - Burgenland1901fszek
 
Triászok - március - Bécs
Triászok - március - BécsTriászok - március - Bécs
Triászok - március - Bécs1901fszek
 
Powerpoint 2003
Powerpoint 2003Powerpoint 2003
Powerpoint 2003Uuz Zeaps
 
INROADS presentatie
INROADS presentatieINROADS presentatie
INROADS presentatieINROADS
 

En vedette (19)

調和道 『藤田霊斎 丹田呼吸法』 Zen Breathing
調和道 『藤田霊斎 丹田呼吸法』 Zen Breathing調和道 『藤田霊斎 丹田呼吸法』 Zen Breathing
調和道 『藤田霊斎 丹田呼吸法』 Zen Breathing
 
2013 hub kaho university college onderwijsdag lezing ttt 5 rolmodel v2
2013 hub kaho university college onderwijsdag lezing ttt 5 rolmodel v22013 hub kaho university college onderwijsdag lezing ttt 5 rolmodel v2
2013 hub kaho university college onderwijsdag lezing ttt 5 rolmodel v2
 
Sealy Publications
Sealy   PublicationsSealy   Publications
Sealy Publications
 
Engraving Services Australia
Engraving Services AustraliaEngraving Services Australia
Engraving Services Australia
 
Werken aan waardengedreven netwerkorganisatie bij AgSO Pascal Van Loo, Pasas ...
Werken aan waardengedreven netwerkorganisatie bij AgSO Pascal Van Loo, Pasas ...Werken aan waardengedreven netwerkorganisatie bij AgSO Pascal Van Loo, Pasas ...
Werken aan waardengedreven netwerkorganisatie bij AgSO Pascal Van Loo, Pasas ...
 
Pasas Case Complex Groupmediation
Pasas Case Complex GroupmediationPasas Case Complex Groupmediation
Pasas Case Complex Groupmediation
 
2011 TTT VOV The Training Transition Lancering
2011 TTT VOV The Training Transition Lancering2011 TTT VOV The Training Transition Lancering
2011 TTT VOV The Training Transition Lancering
 
Clark
ClarkClark
Clark
 
Pasas Mediation op vov beurs 2013
Pasas Mediation op vov beurs 2013Pasas Mediation op vov beurs 2013
Pasas Mediation op vov beurs 2013
 
Presentatie Pascal Van Loo via SD WOrx voor kbc adviesvaardigheden v5
Presentatie Pascal Van Loo via SD WOrx voor kbc adviesvaardigheden v5Presentatie Pascal Van Loo via SD WOrx voor kbc adviesvaardigheden v5
Presentatie Pascal Van Loo via SD WOrx voor kbc adviesvaardigheden v5
 
Sealy Publications
Sealy   PublicationsSealy   Publications
Sealy Publications
 
Vergadertechnieken essentie in 3 slides en 6 tips op #hautekiet radio 1 door ...
Vergadertechnieken essentie in 3 slides en 6 tips op #hautekiet radio 1 door ...Vergadertechnieken essentie in 3 slides en 6 tips op #hautekiet radio 1 door ...
Vergadertechnieken essentie in 3 slides en 6 tips op #hautekiet radio 1 door ...
 
20141124 presentation innovative knowledge sharing put into practice in 3 cas...
20141124 presentation innovative knowledge sharing put into practice in 3 cas...20141124 presentation innovative knowledge sharing put into practice in 3 cas...
20141124 presentation innovative knowledge sharing put into practice in 3 cas...
 
20161021 pascal van loo ervaringsleren bij organisatieverandering v publicatie
20161021 pascal van loo ervaringsleren bij organisatieverandering v publicatie20161021 pascal van loo ervaringsleren bij organisatieverandering v publicatie
20161021 pascal van loo ervaringsleren bij organisatieverandering v publicatie
 
Kalandorok - március - Burgenland
Kalandorok -  március - BurgenlandKalandorok -  március - Burgenland
Kalandorok - március - Burgenland
 
Triászok - március - Bécs
Triászok - március - BécsTriászok - március - Bécs
Triászok - március - Bécs
 
Powerpoint 2003
Powerpoint 2003Powerpoint 2003
Powerpoint 2003
 
Uus tugas
Uus tugasUus tugas
Uus tugas
 
INROADS presentatie
INROADS presentatieINROADS presentatie
INROADS presentatie
 

Similaire à Node js quick-tour_v2

Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsasync_io
 
Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS drupalcampest
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.jsorkaplan
 
Node.JS and WebSockets with Faye
Node.JS and WebSockets with FayeNode.JS and WebSockets with Faye
Node.JS and WebSockets with FayeMatjaž Lipuš
 
Dcjq node.js presentation
Dcjq node.js presentationDcjq node.js presentation
Dcjq node.js presentationasync_io
 
Node js实践
Node js实践Node js实践
Node js实践jay li
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialTom Croucher
 
Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Pierre Joye
 
T4T Training day - NodeJS
T4T Training day - NodeJST4T Training day - NodeJS
T4T Training day - NodeJSTim Sommer
 
Laug Mootools And Common Js
Laug   Mootools And Common JsLaug   Mootools And Common Js
Laug Mootools And Common JsSkills Matter
 
Introduction to node.js by jiban
Introduction to node.js by jibanIntroduction to node.js by jiban
Introduction to node.js by jibanJibanananda Sana
 
Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?Felix Geisendörfer
 
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)Tech in Asia ID
 

Similaire à Node js quick-tour_v2 (20)

Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.js
 
Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS
 
Node azure
Node azureNode azure
Node azure
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
Node.JS and WebSockets with Faye
Node.JS and WebSockets with FayeNode.JS and WebSockets with Faye
Node.JS and WebSockets with Faye
 
Dcjq node.js presentation
Dcjq node.js presentationDcjq node.js presentation
Dcjq node.js presentation
 
Node js实践
Node js实践Node js实践
Node js实践
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js Tutorial
 
Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18
 
T4T Training day - NodeJS
T4T Training day - NodeJST4T Training day - NodeJS
T4T Training day - NodeJS
 
nodecalgary1
nodecalgary1nodecalgary1
nodecalgary1
 
Laug Mootools And Common Js
Laug   Mootools And Common JsLaug   Mootools And Common Js
Laug Mootools And Common Js
 
Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
 
Introduction to node.js by jiban
Introduction to node.js by jibanIntroduction to node.js by jiban
Introduction to node.js by jiban
 
Rack
RackRack
Rack
 
What is Node.js
What is Node.jsWhat is Node.js
What is Node.js
 
Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?
 
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
 
Nodejs - A quick tour (v5)
Nodejs - A quick tour (v5)Nodejs - A quick tour (v5)
Nodejs - A quick tour (v5)
 

Node js quick-tour_v2