Installing node and the necessary dependencies was pretty simple:
# install NVM (nodejs version manager)
curl https://raw.github.com/creationix/nvm/master/install.sh | sh
# install nodejs
nvm install 0.8.16
# I'm not certaint if this is required but I USE and set this version of nodejs as default.
nvm use 0.8.16
nvm alias default 0.8.16
# install the mustache template library
npm install mustache
# install the sprintf library because it's simple
npm install sprintf
(snipped from here)
This example might work in a browser but it does not seem to work in NodeJS. As an aside there was a CoffeeScript version that I liked but I was not going to install CoffeeScript as a dependency for this little trinket.
Ultimately I implemented this:
and it worked great. I put the rest of the bits together and I'm generating SQL like I had hoped. By the time I have to run this script again I hope to clean it up and automate it so I never have to run it again.