Node Boilerplate Project for Force.com with Express, Nforce & Async

I have to say that I'm addicted to Node. There are a ton of reasons why Node is awesome, but I like the fact that it is powerful, extensible and easy to get a new app up and running quickly. Over at CloudSpokes we actually have more Node apps in production now than we do rails apps and that number is growing.

So a couple of months ago I wrote a Node.js demo with Force.com REST API, OAuth & Express which was a good starter app. However, it uses the web server flow which we typically don't use for production apps. Since then I fallen in love with Kevin O'Hara's Node package nforce. Not only did Kevin implement both the web server and username & password flows, but I have to say that I really like way that Kevin implemented other features like support for Express middleware, query streaming and Force.com Streaming API. I've contributed a little to the package not not enough to be proud of myself.

So I modified my simple CRUD boilerplate app to use nforce and async. If you are not familiar with async it is an awesome package that makes it easier to work with asynchronous JavaScript events. In the Account show method below, I use async to make calls in parallel to get the Account plus the number of Contacts for the Account.