Node: References and Resources

Submitted by shelley on Sun, 06/03/2012 - 13:53

During my explorations of Node.js, I came across many excellent resources, references, tutorials, and various other online publications related to the technology. I had planned on incorporating this material into an appendix for Learning Node but decided it would make a better online resource than a book chapter.

Every person interested in Node should start with the Node.js web site, as well as the web site for npm, the application that manages Node module installations:

  • Node.js web site
  • The Node API documentation pages
  • Build and installation instructions for Node
  • The Node.js blog
  • The npm web site
  • npm documentation

If you're interested in Node in a Windows environment, you might a little extra help in getting set up. I recommend the following resources:

  • A video tutorial on installing and running Node in Windows
  • Tomek on Software provides a nice guide on Developing Node.js applications in Web Matrix and testing with IIS Express
  • Steve Sanderson provides Node.js site templates for WebMatrix
  • Scott Hanselman also provides a how to on getting started with Node.js and WebMatrix
  • The Microsoft folks provided a how to on Node applications on Azure
  • The Microsoft Azure folks also provide a Node.js Developer Center
  • Aaron on the Web provides an intro into Node.js for .NET Developers

There's an enormous number of resources for the Node.js newbie, including basic tutorials and entire online books. I know there are more than what I discovered, but the following is a good start:

One person, Felix Geisendörfer, has provided several excellent online resources for new and experienced Node folks:

  • Node.js Beginner's Guide
  • Convincing the Boss Guide
  • Community Guide
  • Node.js Style Guide

As you learn Node, you'll hear about the Node event loop. The following are a couple of good articles on the event loop:

  • Mixu's Understanding the Node event loop
  • The interestingly named Node.js, Doctor’s Offices and Fast Food Restaurants – Understanding Event-driven Programming

REPL is the Node interactive stand alone application. REPL stands for Read-Eval-Print-Loop. Following are good REPL resources:

  • If you're interested in using Vim with CoffeeScript and REPL, check out Thorsten Lorenz's Vim, CoffeeScript, and the Node REPL
  • REPL not enough? Try Ultra REPL
  • Dr. Axel Rauschmayer covers how to Execute code each time the Node.js REPL starts
  • The Nodejitsu folks provide a handy guide on how to use REPL
  • The Nodejitsu folks also provide a how to on creating a custom REPL

Modules are the heart and soul of Node.js. It can be an interesting experience finding Modules, because you need to look carefully among the many available to see which are the ones currently supported, and which have, more or less, been abandoned. Luckily, there are good Node module resources:

  • The npm registry
  • The Node Module Wiki
  • The newer Nipster
  • My personal favorite: The Node Toolbox

A good rule of thumb about which module to use is check for recent activity in the module's repository. Are there outstanding issues? Pull requests that have gone unanswered for a long time? Also do a Google search, see who is using the module, for what, and how recently.

For more on npm, itself, do check out the Developer guide. Also spend some time understanding the differences between global and local installation of modules.

Node is based on the CommonJS model. If you want to learn more about CommonJS, I recommend Taking baby steps with Node.js--CommonJS and creating custom modules.

The heart of the module system is the package.json file. Nodejitsu provides an article and a couple of good cheat sheets related to package.json and npm:

  • package.json dependencies done right
  • npm cheat sheet
  • package.json cheat sheet

Peter Krumin did a great series of articles on Node.js Modules you should know about. Several of my favorite are included in the list.

If you work with Node, and you write modules, chances are you're going to become intimately involved with EventEmitter. The following are good EventEmitter resources and references:

  • Inheritance and Initialization in Node.js
  • Node.js EventEmitter example with custom events
  • Writing my First Node.js Module and Event Emitter

Control flow is a big topic of interest for Node developers:

  • Mixu's Node Book: Chapter 7 focuses on control flow
  • Metaduck covers Asynchronous iteration patterns in Node
  • Domenick Denicola put together a slideshow titled Callbacks, Promises, and Coroutines
  • Alex Young provides a PDF titled Node Flow Control
  • Steve Hanov covers the Four ways of handling asynchronous operations in Node.js
  • Isaac Schlueter discusses Flow control in npm
  • Hack Sparrow provides a good article on Managing Nesting Asynchronous Callbacks in Node
  • More on the asynchronous callback by Tim Caswell at Control Flow in Node Part II with follow up article at Control Flow Node in Part III
  • Mark Fasel writes Asynchronous Code Design with Node.js

There are good frameworks for Node, but I focused on Connect/Express. I felt that Express was more Node-like, and requires less upfront time than the other frameworks. That's not to say there weren't challenges with Express, as it went from Express 2.x to Express 3.x and then back down to Express 2.x, but one adapts. I focused on Express 3 in the book.

Connect is the middleware layer for Express. TJ Holowaychuk provides an introduction to Connect 2 at Connect 2.0. The Express web site is at Express.com, though note that the documentation is still focused on Express 2. For the Express 2 developer, check out the Migrating from 2.x to 3.x guide. Mike Valstar writes specifically about Express error handling and 404 pages.

I grew fond of Redis when working with Node.js. The Redis site is at redis.io. Redis is nicely documented, at the site and in the Little Redis Book.

Following are other articles and links of interest, in no particular order or grouping:

Hack Sparrow article on running Express application in a production environment www.hacksparrow.com/running-express-js-in-production-mode.html. Charlie Robbins provides a how-to on distributing Node.js apps with Hook.io at blog.nodejitsu.com/distribute-nodejs-apps-with-hookio. More on the Hook.io module at ejeklint.github.com/2011/09/23/hook.io-for-dummies-part-1-overview/.

Rasmus Andersson wrote a Template for setting up Node.js-backed web apps on EC2 at rsms.me/2011/03/23/ec2-wep-app-template.html. Another writing on setting up Node on Amazon EC2 from Ben Nadel at www.bennadel.com/blog/2321-How-I-Got-Node-js-Running-On-A-Linux-M....

A XSS (Cross Site Scripting) Cheat Sheet can be found at ha.ckers.org/xss.html. Another cheat sheet, this time on SQL Injection at ferruh.mavituna.com/sql-injection-cheatsheet-oku/.

Heroku provides instructions on how to create a self-signed SSL certificate at https://devcenter.heroku.com/articles/ssl-certificate-self. Another tutorial on the same subjec. at www.akadia.com/services/ssh_test_certificate.html.

I don't cover backbone.js in the book, but an article on combing it with MongoDB, Mongoose, and Restify can be read at backbonetutorials.com/nodejs-restify-mongodb-mongoose/.

A comparison of Redis and Cassandra hammerprinciple.com/databases/items/redis/cassandra. More on Apache Cassandra at cassandra.apache.org/. Redis is compared with Memcached at webdevrefinery.com/forums/topic/8221-memcached-vs-redis/. The Memcached web site is at memcached.org/.

Guillermo Rauch's Use Jade Blocks, not Layouts, at www.devthought.com/code/use-jade-blocks-not-layouts/.

Curl is your friend when testing RESTful applications. Some helpful examples at www.yilmazhuseyin.com/blog/dev/curl-tutorial-examples-usage/.
The Ruby on Rails routing guide applies equally well to Node: guides.rubyonrails.org/routing.html.

Charlie McConnell wrote an article on "How to use stream.pipe" at docs.nodejitsu.com/articles/advanced/streams/how-to-use-stream-pipe.

One of the better, more thorough answers I've seen at Stack Overflow is the answer to "What is the Difference between proxy server and reverse proxy server" at stackoverflow.com/questions/224664/difference-between-proxy-serve....

Guillermo Rauch wrote a multipart tweet filtering proxy, beginning with Part 1 at www.devthought.com/2012/01/24/filtering-tweets-for-your-favorite-....

Shravya Garlapati at LinkedIn, wrote a very helpful article, Blazing Fast node.js: 10 performance tips from LinkedIn Mobile engineering.linkedin.com/nodejs/blazing-fast-nodejs-10-performanc....

The Async module can be found at https://github.com/caolan/async. More on the creation of Async at caolanmcmahon.com/posts/asynchronous_code_in_node_js.

The Step module is located at https://github.com/creationix/step.
There is promise support in Node with Q at https://github.com/kriskowal/q, and deferred https://github.com/medikoo/deferred, as well as Futures https://github.com/coolaj86/futures.

Yes, you can use Node modules with client-side JavaScript with help from RequireJS at requirejs.org/. And you can scrape web pages using Node, jQuery, and Jsdom, with a little help from this article liamkaufman.com/blog/2012/03/08/scraping-web-pages-with-jquery-no....

Since Node is based on the CommonJS model, read more about CommonJS at www.commonjs.org/. An interesting article on Node, CommonJS, and custom modules by Jan Van Ryswyck can be found at elegantcode.com/2011/02/04/taking-baby-steps-with-node-js-commonj....

A Nodejitsu article on using the Process module can be found at docs.nodejitsu.com/articles/getting-started/the-process-module. More on Node and processes by at dailyjs.com/2012/03/22/unix-node-processes/.

More on TCP Socket Programming in Node.js at www.hacksparrow.com/tcp-socket-programming-in-node-js.html. A general article on TCP vs. UDP can be found at www.skullbox.net/tcpudp.php. More on UDP Networking at twistedmatrix.com/documents/current/core/howto/udp.html.

If you're curious about the performance differences between using process.nextTick and setTimeout, you can view benchmark tests at https://gist.github.com/1257394.

  • spacer Printer-friendly version
  • spacer Send by email
  • spacer PDF version
spacer Send to Kindle
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.