Last Updated: February 25, 2016
·
128
· marco_mazzocchi

A quick node & coffee integration

I'm starting to write a script in nodeJS and I would like to use at the same time coffeescript syntax so I write this shortcut to be added in my .bash_profile configuration (for Mac)

function cofnode {
    coffee -c $1.coffee
    node $1.js
}

now I can launch the command:

cofnode file_name

and it will automatically compile the file_name.coffee file into a javascript that will be automatically launched on node