But on a whim the other day I revisited it and thankfully now it does work on plain old WSH without any coaxing (not sure what changed, or what I was doing wrong last time). I took the full browser-based coffee-script.js and wrapped it with a simple *.wsf and batch file to handle command-line options.
It’s on github, natch: https://github.com/duncansmart/coffeescript-windows
To use it, invoke
coffee.cmd like so:
coffee input.coffee output.js
You can also pipe to and from it if you are so inclined via
stdin/out. Errors are written to
In the test directory there’s a version of the standard CoffeeScript tests which can be kicked off using test.cmd. Note that the test just attempts to compile the standard set of *.coffee test files but doesn’t execute them.
Hope it helps; comments appreciated!
2 thoughts on “The simplest way to compile CoffeeScript on Windows”
Looks neat but as newbie to nodejs/coffee, I’m not sure what to do with the files. For example, I have nodejs installed and working from a usb drive in a Win7 environment. I installed coffee-script via npm and there is an extensive install directory. Do I put _all_ your files in the node_modules directory or in a separate directory? TIA for any guidance.