Kevin Gorski

I turn good ideas into great products for start-ups and small businesses

Node.js

Node.js has had the development community's attention since Ryan Dahl's introduction to it in 2009, but in the second half of 2010 it became both stable enough to use and an impressive set of modules to make it useful for a variety of tasks.

What Is It?

"Node's goal is to provide an easy way to build scalable network programs." This could be Web sites or clients/servers that talk directly over TCP, or anything, really. When writing a Node.js application, you're writing JavaScript that is going to be handled by Google's V8 engine, which itself is written in C++. The core of Node.js provides modules and objects that you use in JavaScript that are implemented in C++. The flow of an application is controlled by an event loop, which in itself is not unique (there are libraries for Python, Ruby, and other languages that also run like this). By setting the precedent that all potentially blocking calls should be asynchronous/evented, the time spent blocking can be minimized and the application can do more useful work in the same amount of time within the same environment.

Node.js modules conform to the CommonJS specification, which immediately made general purpose JavaScript modules that conform to the spec available to use in this new context.

Why Do I Care?

Node is interesting to me because JavaScript can be fun to write and the energy of the community that's sprung up around it is infectious. The potential performance benefits for networked applications are nice, but since I haven't had to fight for performance on any of the projects I've used it for it's only been theoretical for me. Any time a discussion about server side JavaScript comes up, the possibility of writing code that can run on both the client and server is brought up, but in practice I've found that there's a very small amount of code that you'd actually want to re-use on both platforms. The resulting code is also somewhat awkward to write.

What Have I Done With Node.js?

When I started learning about Node in November 2010, I decided to start a blog detailing what I've learned called Node Nerd for a few reasons. I didn't really have a place where I was writing about technology yet and if felt like a topic that I was already excited about would be a good first venture. The first set of articles are mostly quick introductions, but as I get a good base of articles established I will write about more sophisticated modules and techniques.

The product of these first articles is the GitHub Commit Monitor, a very simple, single-page web application that lists the most recent commits for a GitHub repository by using their REST API.

I have some other ideas for projects to build with Node.js, but I'm going to put off talking them up until I have some code to show.