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

583a0cfd3e0ec851166c5c6fa5e506a5?s=128

Raquel Vélez

April 26, 2013
Tweet

Transcript

  1. Node.js: The Good Parts There's a new kid in town;

    time to say hello. Brought to you by @rockbot
  2. Welcome to the Playground (Ruby) (Python) Scheme Go Erlang Clojure

    (JavaScript) (PHP) (C#)
  3. Node === Awesomesauce ◦ Quick ◦ Independent ◦ Familiar ◦

    Modular ◦ Plays well with others ◦ MVP of MVC ◦ Widely used ◦ Super easy to get started
  4. Fast and Asynchronous Powered by the V8 JavaScript Engine Evented,

    non-blocking I/O
  5. Single Thread, Non-Blocking Time Blocking Non-Blocking

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

  7. Everywhere You Want to Be It's just JavaScript! Easy context

    switching between front-end and backend
  8. Party with npm modules : node :: gems : ruby

    lots of small, modular packages that can be added to programs via require
  9. Use it Your Way Favorite DBs: ◦ MongoDB ◦ CouchDB

    ◦ MySQL ◦ and more! Preprocessors: ◦ Jade (HTML) ◦ Stylus (CSS) ◦ ERB ◦ Sass
  10. Model-View-Controller? Totally! Customize your experience with a framework like Express

    or Flatiron to help organize your code
  11. JIFASNIF JavaScript is fun and so node is fun! #nodejs

    IRC, Google Groups, GitHub, Twitter, Meetups, Conferences...!
  12. Node.js in the Wild Companies that use node.js right now

  13. Ready to Start your Relationship? Spin up a server in

    no time... and get hacking!
  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/');
  15. Basics: A Really Simple Web Server % node example.js Server

    running at http://127.0.0.1:1337/
  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
  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
  18. Raquel Vélez @rockbot Engineer rockbot@storify.com