I’m using coffeescript while writing a node js app and use cake watch to compile my js files real time.
That’s great to be able to do that – but where should I stick those js files? Right now, I’m saving them right next to their respective coffeescript files, but that just feels awkward…
The convention I’ve gotten comfortable with is to put CoffeeScript files in a
srcdirectory and have “compiled” JavaScript output to alibdirectory. Like so:package.jsonlib/mymodule.jssrc/mymodule.coffeeIf you publish the module to the npm registry, you can just include the resulting
libdirectory, which is conventionally where projects written in JavaScript keep there.jsfiles. This keeps everything consistent.