Fix issue with npm upgrade on node.js v0.8
Merge pull request #256 from simondean/npm_upgrade_failure

Fix issue with npm upgrade on node.js v0.8
Added support for writing output to file (close #90)