Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Node.js: The Good Parts

Node.js: The Good Parts

There's a new kid in town.

Find out what's great about node and why it's so hot right now!

Presented at #convergese on 26 April 2013

Raquel Vélez

April 26, 2013
Tweet

More Decks by Raquel Vélez

Other Decks in Technology

Transcript

  1. Node.js:
    The Good Parts
    There's a new kid in town;
    time to say hello.
    Brought to you by @rockbot

    View Slide

  2. Welcome to the Playground
    (Ruby)
    (Python)
    Scheme
    Go
    Erlang
    Clojure
    (JavaScript)
    (PHP)
    (C#)

    View Slide

  3. Node === Awesomesauce
    ○ Quick
    ○ Independent
    ○ Familiar
    ○ Modular
    ○ Plays well with others
    ○ MVP of MVC
    ○ Widely used
    ○ Super easy to get started

    View Slide

  4. Fast and Asynchronous
    Powered by the V8 JavaScript Engine
    Evented, non-blocking I/O

    View Slide

  5. Single Thread, Non-Blocking
    Time
    Blocking Non-Blocking

    View Slide

  6. Single Thread, Non-Blocking
    Time
    Multi-Threaded,
    Blocking
    Non-Blocking

    View Slide

  7. Everywhere You Want to Be
    It's just JavaScript!
    Easy context switching between
    front-end and backend

    View Slide

  8. Party with npm
    modules : node :: gems : ruby
    lots of small, modular packages that
    can be added to programs via require

    View Slide

  9. Use it Your Way
    Favorite DBs:
    ○ MongoDB
    ○ CouchDB
    ○ MySQL
    ○ and more!
    Preprocessors:
    ○ Jade (HTML)
    ○ Stylus (CSS)
    ○ ERB
    ○ Sass

    View Slide

  10. Model-View-Controller?
    Totally!
    Customize your experience with a
    framework like Express or Flatiron to
    help organize your code

    View Slide

  11. JIFASNIF
    JavaScript is fun and so node is fun!
    #nodejs
    IRC, Google Groups, GitHub, Twitter,
    Meetups, Conferences...!

    View Slide

  12. Node.js in the Wild
    Companies that use node.js right now

    View Slide

  13. Ready to Start your
    Relationship?
    Spin up a server in no time...
    and get hacking!

    View Slide

  14. Basics: A Really Simple
    Web Server
    var http = require('http');
    http.createServer(function (req, res) {
    res.writeHead(200, {'Content-Type':
    'text/plain'});
    res.end('Hello World\n');
    }).listen(1337, '127.0.0.1');
    console.log('Server running at http://127.
    0.0.1:1337/');

    View Slide

  15. Basics: A Really Simple
    Web Server
    % node example.js
    Server running at http://127.0.0.1:1337/

    View Slide

  16. Basics: A Really Simple
    Web Server
    % npm install express
    % express projectName
    % cd projectName && npm install
    % node app.js
    Server running at http://localhost:3000

    View Slide

  17. node.js:
    The Less Good Parts
    ○ "Pyramid of Doom"
    ○ Core keeps changing
    ○ Too many options
    ○ Overkill for static sites
    ○ Scalability
    ○ Memory leaks (closures)
    ○ CoffeeScript, etc

    View Slide

  18. Raquel Vélez
    @rockbot
    Engineer
    [email protected]

    View Slide