Node.js experimentation - a GitHub clone script

Posted on Thu 19 January 2012 in Coding

Recently I wrote my first Node.js program! Yeah, yeah, I know! Late to the game and all that! But I thought it was time to catch up with the rest of the world. Better late than never, right? (Also, the program needed to parse JSON data, so JavaScript felt like a natural choice.)

What I wrote is a tiny script that clones all non-forked repositories, including gists, from GitHub. It’s nothing advanced at all, and I certainly didn’t tap the full potential of the event-driven architecture of Node.js. But it was fun to write JavaScript code again, and it was fun to write asynchronous code. My colleague Aslam Khan says that it’s a challenge to put your mind into “async mode”, and I couldn’t agree more. But once you have done it, endless new possibilities open up! :-)

Anyhow, less talk, more code:a