I've not used this myself but I came across it a while ago: grunt-rerun
. Used in combination with a watch task you can pause a long running task such as express (but probably would work with nodemon as well), run some tasks, then start the task again. The sample config looks like so:
grunt.initConfig({
watch: {
dev: {
files: ['server/*.js'],
//Note the :go flag used for sending the reload message to the rerun server
tasks: ['clean','rerun:dev:express:go']
},
},
express: {
dev: {
options: {
port: 3000,
bases: ['/public'],
keepalive: true,
server: path.resolve('./server/app.js')
}
}
},
// Configuration to be run (and then tested).
rerun: {
dev: {
options: {
tasks: ['express']
},
},
}
})
https://npmjs.org/package/grunt-rerun
I'm not entirely sure about the live reload thing. My guess would be because it shuts down the process, by spawning a new one it would load the page afresh, but I haven't used this personally so I'm not sure.
The second alternative is yes, to use a command prompt that supports multiple tabs, such as Console. I'm a Mac user and so I use iTerm 2 which has multiple panes; most of the time I have four open per project, for watch
, testem
, a php server and a shell for everything else. You may find that this is a lot quicker and a lot less hassle.
Just a quick note on Coffeescript, a lot of JavaScript developers don't use it, so to get a wider audience to understand your source code, it may be good practice to compile coffee into js before you post your question.