Hey Nik,
CoffeeScript and Streamline both come with a require() hook that lets you simply require() your .coffee and ._js/._coffee files as if they were regular .js files, compiling them on the fly each time.
So you can have your top-level JS (e.g. app.js or server.js) simply register these hooks and then require() your files like normal:
// e.g. app.js
require('coffee-script'); // registers automatically
require('streamline').register();
require('./app._coffee');
// app._coffee
console.log 'hello...'
setTimeout _, 1000
console.log '...world'
The only downside to this approach is that each compilation takes a bit of time. Streamline has support for caching built-in if you pass {cache: true}, to the register() call.
But that doesn't cache the CoffeeScript compilation, and the cache doesn't keep up with CoffeeScript version changes, so I made a little helper a while back to do a bit smarter caching for both:
We use this with node-dev, a really robust supervisor I've come to really love:
And it works great. This is our "top-level" JS file:
I've been meaning to ask Bruno about whether it might make sense for some of this better CoffeeScript support / smarter caching to be in Streamline proper, so it'd be great to get your thoughts.
Hope this helps!
Aseem