Node.JS
Server side javascript
Intro

    Good old javascript

    But server side

    Fully asynchronus

    “Buzz” technology
Use cases

    Real time web applications

    Messaging

    File download

    Anything that spends lot of time waiting for
    something
Differences from Web browser

    CommonJS – http://wiki.commonjs.com

    Modules
    
        Npm – http://www.npmjs.org

    File system, external process and network API
Programming paradigm

    Non blocking operations

    Functional programming
    
        Lazy – doing only when needed

    Event based
    
        Do something when something happens
Example




     HTTP server, which
     serves movie.avi from
        current directory
Modules
    
        require();
    
        exports functions and
        variables from from
        files module.exports
callbacks
     
         most common code
         construct
     
         functions are
         variables
     
         non-blocking
     
         “this” magick
           – var self = this; trick
Thank you!

Node.JS

  • 1.
  • 2.
    Intro  Good old javascript  But server side  Fully asynchronus  “Buzz” technology
  • 3.
    Use cases  Real time web applications  Messaging  File download  Anything that spends lot of time waiting for something
  • 4.
    Differences from Webbrowser  CommonJS – http://wiki.commonjs.com  Modules  Npm – http://www.npmjs.org  File system, external process and network API
  • 5.
    Programming paradigm  Non blocking operations  Functional programming  Lazy – doing only when needed  Event based  Do something when something happens
  • 6.
    Example HTTP server, which serves movie.avi from current directory
  • 7.
    Modules  require();  exports functions and variables from from files module.exports
  • 8.
    callbacks  most common code construct  functions are variables  non-blocking  “this” magick – var self = this; trick
  • 9.