NodeJS
briefly introduced




                by   Alexandre Lachèze
What’s NodeJS ?
What’s NodeJS ?
What’s JS ?
The world’s most misunderstood programming
language has become the world’s most popular
            programming language.

                      – Douglas Crockford
What’s JS ?

Programming language for browsers




             JS
What’s JS ?

Programming language for browsers




      "Hello world".toUpperCase()
                   .charAt(3);
What’s JS ?

Programming language for browsers




  document.getElementById("content")
          .appendChild("<div>Hello</div>");
Prototypal      Totally
                             Event-driven
inheritance   asynchronous
Prototypal          Totally
                                                 Event-driven
inheritance       asynchronous


              Cat.prototype = {
                 meow :function() {
                   return this.name+" miaou.";
                 }
              };
Prototypal          Totally
                                             Event-driven
inheritance       asynchronous


              Dog.prototype = {
                 meow : Cat.prototype.meow
              };
Prototypal          Totally
                                             Event-driven
inheritance       asynchronous


          var result = db.query("select * from T");
          //use result
Prototypal          Totally
                                             Event-driven
inheritance       asynchronous


          $.ajax("/query.json", function(result) {
            //use result
          });
Prototypal          Totally
                                             Event-driven
inheritance       asynchronous


          el.addEventListener("click", function(evt) {
            alert("you clicked me ?!");
          });
JS

browser-side
$>_



        JS

      server-side
Node

The API should be familiar to client-side JS
programmers and old school UNIX hackers.
                                – Ryan Dahl
Node

The API should be familiar to client-side JS
programmers and old school UNIX hackers.
                                – Ryan Dahl
Node
    v0.8.7

 started 2009
What’s inside ?
What’s inside ?

      V8

                         C/C++



            .JS
      Chrome’s JS engine V8
What’s inside ?



             Vs.

Event loop         Multi-thread
What’s inside ?




Event loop
What’s around ?




        npm
What’s around ?




   opensource community
          energy
Node for what ?




real-time web   extensive I/O
 applications    applications
Why node ?




   fast       scalable
(presumed)   (presumed)
LinkedIn
Node

Try it !
    that’s just JS.
Modules
                                                                 npm


             Resources                                           modules wiki

                                                                 express (web framework)
                                                                 connect
Me                         Nginx                                 socket.io
github.com/alexstrat       nginx architecture                    node-inspector
                           Making applications scalable          meteor (web framework)
Node official               with load balancing

nodejs.org                 Why Events Are A Bad Idea (for
                                                                 LinkedIn
Joyent                     high-concurrency servers)             How LinkedIn used Node.js and HTML5
                                                                 to build a better, faster app
API
Introduction to Node.js
                           Javascript                            Blazing fast node.js: 10 performance
                                                                 tips from LinkedIn Mobile
with Ryan Dahl
                           JS : The World's Most Misunderstood
                           Programming Language, Douglas
Slides from JSConf 2009    Crockford
Slides from JSConf 2010    JS : The Good Parts, Douglas
                                                                 Slides
(benchmarks inside !)      Crockford, O'Reilly                   thenounproject.com

                           JS Patterns, Stoyan Stefanov,         colourslovers.com
V8                         O'Reilly
                                                                 slideshare.net/EmilandDC
code.google.com/p/v8/      JS Garden
                                                                 Slide design for developpers, Zach
developers.google.com/v8   Details of the object model, MDN      Holman

Node.JS briefly introduced

  • 1.
    NodeJS briefly introduced by Alexandre Lachèze
  • 2.
  • 3.
  • 4.
  • 5.
    The world’s mostmisunderstood programming language has become the world’s most popular programming language. – Douglas Crockford
  • 6.
    What’s JS ? Programminglanguage for browsers JS
  • 7.
    What’s JS ? Programminglanguage for browsers "Hello world".toUpperCase() .charAt(3);
  • 8.
    What’s JS ? Programminglanguage for browsers document.getElementById("content") .appendChild("<div>Hello</div>");
  • 9.
    Prototypal Totally Event-driven inheritance asynchronous
  • 10.
    Prototypal Totally Event-driven inheritance asynchronous Cat.prototype = { meow :function() { return this.name+" miaou."; } };
  • 11.
    Prototypal Totally Event-driven inheritance asynchronous Dog.prototype = { meow : Cat.prototype.meow };
  • 12.
    Prototypal Totally Event-driven inheritance asynchronous var result = db.query("select * from T"); //use result
  • 13.
    Prototypal Totally Event-driven inheritance asynchronous $.ajax("/query.json", function(result) { //use result });
  • 14.
    Prototypal Totally Event-driven inheritance asynchronous el.addEventListener("click", function(evt) { alert("you clicked me ?!"); });
  • 15.
  • 16.
    $>_ JS server-side
  • 17.
    Node The API shouldbe familiar to client-side JS programmers and old school UNIX hackers. – Ryan Dahl
  • 18.
    Node The API shouldbe familiar to client-side JS programmers and old school UNIX hackers. – Ryan Dahl
  • 19.
    Node v0.8.7 started 2009
  • 20.
  • 21.
    What’s inside ? V8 C/C++ .JS Chrome’s JS engine V8
  • 22.
    What’s inside ? Vs. Event loop Multi-thread
  • 23.
  • 24.
  • 25.
    What’s around ? opensource community energy
  • 26.
    Node for what? real-time web extensive I/O applications applications
  • 27.
    Why node ? fast scalable (presumed) (presumed)
  • 28.
  • 29.
    Node Try it ! that’s just JS.
  • 30.
    Modules npm Resources modules wiki express (web framework) connect Me Nginx socket.io github.com/alexstrat nginx architecture node-inspector Making applications scalable meteor (web framework) Node official with load balancing nodejs.org Why Events Are A Bad Idea (for LinkedIn Joyent high-concurrency servers) How LinkedIn used Node.js and HTML5 to build a better, faster app API Introduction to Node.js Javascript Blazing fast node.js: 10 performance tips from LinkedIn Mobile with Ryan Dahl JS : The World's Most Misunderstood Programming Language, Douglas Slides from JSConf 2009 Crockford Slides from JSConf 2010 JS : The Good Parts, Douglas Slides (benchmarks inside !) Crockford, O'Reilly thenounproject.com JS Patterns, Stoyan Stefanov, colourslovers.com V8 O'Reilly slideshare.net/EmilandDC code.google.com/p/v8/ JS Garden Slide design for developpers, Zach developers.google.com/v8 Details of the object model, MDN Holman