Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Server-Side JavaScript
   Developement
     Node.JS Quick Tour

    q3boy <q3boy1@gmail.com>
Server-Side JavaScript
    Development
Aptana Jaxer (SpiderMonkey)




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

•   JSConf, by Chris Williams & Iterative Designs

•   Node, by R...
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...
• 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 main.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 Co...
$ 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 ...
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/inst...
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://...
Server-Side JavaScript Developement - Node.JS Quick Tour
You’ve finished this document.
Download and read it offline.
Upcoming SlideShare
Universal Applications with Universal JavaScript
Next
Upcoming SlideShare
Universal Applications with Universal JavaScript
Next
Download to read offline and view in fullscreen.

25

Share

Server-Side JavaScript Developement - Node.JS Quick Tour

Download to read offline

Server-Side JavaScript Developement - Node.JS Quick Tour

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

Server-Side JavaScript Developement - Node.JS Quick Tour

  1. 1. Server-Side JavaScript Developement Node.JS Quick Tour q3boy <q3boy1@gmail.com>
  2. 2. Server-Side JavaScript Development
  3. 3. Aptana Jaxer (SpiderMonkey) Helma (Rhino)
  4. 4. • •
  5. 5. Revelutions in 2009 • CommonJS (ServerJS), by Dangoor • JSConf, by Chris Williams & Iterative Designs • Node, by Ray Dahl.
  6. 6. Node's goal is to provide an easy way to build scalable network programs -- nodejs.org
  7. 7. Ray Dahl
  8. 8. • 1/5/2009 Ryah Dahl • 2/15/2009 • 5/31/2009 • ...... • 11/16/2010 v0.3.1
  9. 9. • wiki 600 module • 20 •
  10. 10. • libev (event loop) • libeio (nonblocked posix, thread pool) • v8 (javascript engine by google)
  11. 11. • • •
  12. 12. io io
  13. 13. io io
  14. 14. - • • •
  15. 15. - • cpu •
  16. 16. - Web Worker
  17. 17. • 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>
  18. 18. • SSL • Windows • 1G (by v8)
  19. 19. • Web • • Spider
  20. 20. Digg in the node
  21. 21. $ git clone git://github.com/ry/node.git $ cd node $ ./configure --prefix=$HOME/node $ make install
  22. 22. Hello World! Familiar & Simple
  23. 23. $ node singleThread.js 1 2 3 4
  24. 24. CommonJS $ node main.js foobar
  25. 25. io $ node nonblocking.js Reading my.txt ... my.txt Here is contents in "my.txt".
  26. 26. HTTP
  27. 27. TCP $ node tcpServer.js & $ telnet locahost 1234 Welcome! > Node is so Cooool. Node is so Cooool. >
  28. 28. $ node watchFile.js & $ sleep 3; touch my.txt the current mtime is: 1292594780000 the previous mtime was: 1292594752000
  29. 29. $ node childProcess.js hello world
  30. 30. String vs Buffer String • • node v8 String , socket memcopy • v8 gc
  31. 31. String vs Buffer With String
  32. 32. String vs Buffer With Buffer
  33. 33. With String
  34. 34. With Buffer
  35. 35. Want to see more?
  36. 36. • PHP: pear • Python: PyPI, setuptools • Ruby: Gems • Node:
  37. 37. $ 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
  38. 38. IDE base on node http://www.cloud9ide.com/
  39. 39. 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
  • bluenemo

    Jul. 10, 2012
  • ronson1989

    Jun. 1, 2012
  • justjavac

    Mar. 26, 2012
  • wangsenyo

    Feb. 24, 2012
  • faithfulherder

    Dec. 13, 2011
  • MerkerXu

    Nov. 18, 2011
  • MasakazuShinya

    Nov. 3, 2011
  • znaiguang

    Oct. 13, 2011
  • reicky

    Oct. 10, 2011
  • wukezhan

    Sep. 27, 2011
  • liouys

    Sep. 23, 2011
  • mienflying

    Jul. 17, 2011
  • zhangkaizhao

    Jul. 17, 2011
  • rlog

    Jul. 11, 2011
  • KaiQian

    Jul. 9, 2011
  • zshuaibin

    Jul. 6, 2011
  • IUSR

    Jul. 6, 2011
  • imstand

    Jul. 6, 2011
  • vingel

    Jun. 18, 2011
  • barlino

    Jun. 15, 2011

Server-Side JavaScript Developement - Node.JS Quick Tour

Views

Total views

20,664

On Slideshare

0

From embeds

0

Number of embeds

11,933

Actions

Downloads

349

Shares

0

Comments

0

Likes

25

×