JScript で動く CoffeeScript コンパイラのラッパ書いた

Windows でも CoffeeScript 使いたいけど、Cygwin なんて意地でも入れたくない、そんなあなた*1へ。
それっぽいの見当たらなかったので書いてみた。

https://github.com/thinca/coffee-script-on-jscript

特徴

  • 本体 (coffee.bat) と CoffeeScript コンパイラ (coffee-script.js) だけあれば動く。
    • Cygwin 要らない。 (←重要)
  • JScript として動作する。
    • node.js 周りの関数とか使えないので注意。
  • とりあえずコンパイルと実行くらいはできる。

使える機能

今のところ以下。

Usage: coffee [options] path/to/script.coffee

  -c, --compile      compile to JavaScript and save as .js files
  -p, --print        print the compiled JavaScript to stdout
  -s, --stdio        listen for and compile scripts over stdio
  -e, --eval         compile a string from the command line
  -b, --bare         compile without the top-level function wrapper
  -h, --help         display this help message

そのうち入れたい機能。

  • ディレクトリ単位の処理
  • --out オプション
  • --join オプション
  • --watch オプション

参考資料

*1:私だ