What is the easiest way to compile all .coffee files in the current directory and all sub-directories?
The CoffeeScript files are saved with the extension .coffee. You can compile these files using the -c or --compile option of the coffee command as shown below. Suppose there is a file in your system with the following CoffeeScript code which prints a message on the console.
The coffeescript command is now called coffee. The official CoffeeScript extension is now .coffee instead of .cs, which properly belongs to C#. Due to popular demand, you can now also use = to assign.
On installing CoffeeScript on Node.js, we can access the coffee-command line utility. In here, the coffee command is the key command. Using various options of this command, we can compile and execute the CoffeeScript files. You can see the list of options of the coffee command using its -h or --help option.
The %% operator now coerces its right operand only once. It is now possible to require CoffeeScript files from Cakefiles without having to register the compiler first. The CoffeeScript REPL is now exported and can be required using require 'coffeescript/repl'.
you can do so with the integrated coffee
shell tool:
coffee --output lib --compile src
compiles a directory tree of .coffee files in src
into a parallel tree of .js files in lib
. Check http://coffeescript.org/#usage for more details
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With