In 2009 Node.js took Javascript out of the browser and turned it into a general purpose programming language, it wasnt the first (or likely the last) to do so but if you are using JavaScript outside the browser now chances are it is with Node.js. This is how I first got started with Node.js, and why I think its impact goes beyond arguing about spaghetti callbacks.
Sometime around August 2010 I wanted to write an image sharing website, I forgot what existed at the time and why I didn’t want to use it, but it was an excuse to play with the new HTML5 Drag and Drop API which was a good enough reason for me. I knew the server would be very simple, it just needed to save images and serve static webpages, I usually would have gone with a plain CouchDB App (CouchApp) which is perfectly suited for this job however I had been hearing a lot about Node.js so I figured I would try.
I visited the home page – http://nodejs.org, it looked slightly different then but I was instantly impressed, there was a simple code snippet on the front page
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/');
After running through the installation without any hiccups, I copied and pasted that code into a file, ran $ node myserver.js and opened http://127.0.0.1:1337/ in my browser, it was a very pleasant surprise to see node saying “Hello World” right back.
After a little while fiddling around writing terrible code to parse and route HTTP requests, I realised I needed something a bit more elegant, I joined #node.js on IRC and showed them my code, someone quickly replied suggesting I look at express. Again when visiting its website I was instantly impressed, this brand new platform already had a friendly and easy to use web framework.
Once deciding to use express, I had to figure out how to install it, I was given 2 commands:
curl http://npmjs.org/install.sh | sh
npm install express
After a few hours of playing around, and 138 lines of code later I had written my image uploader, I put it live @ http://dropup.net and have been happily using it ever since.
To put this into context I have been programming Erlang for 8+ years, the emphasis towards building real time interactive applications was not a new thing to me, I also slightly prefer Erlang to JavaScript as a language and hugely prefer the Erlang VM to Node.js as a platform. Despite that I continue to this day to lean towards Node.js for my new side projects, why?
Its not because I love JavaScript, I barely even put up with JavaScript, it is because Ryan didnt just write a platform on top of V8, he created one of the best programming communities I have ever seen.
Within months of Node.js being created it was easy to install, had a really well built package manager (which is now included in core), a fully featured web framework as well as all the other open source libraries I could possibly need1, Its IRC channel was busy and helpful and Node Knockout was inspiring programmers the world over to stop writing CRUD frameworks and start writing real time collaborative beat sequencers.
Recently Ryan stepped down from leading the Node.js project and handed over the reigns to none other than NPM author Isaacs Schlueter, I am not sure exactly how the community could get any better, but with Isaac at the helm I am sure it will.
1 Matt Ranneys node_pcap quickly became my favourite and most valuable HTTP debugging tool around.