I'm doing some tutorials and I'm writing everything in CoffeeScript. I then have to compile to JS then execute in node.js. Is there any way to do it directly?
You can Run your JavaScript File from your Terminal only if you have installed NodeJs runtime. If you have Installed it then Simply open the terminal and type “node FileName. js”. If you don't have NodeJs runtime environment then go to NodeJs Runtime Environment Download and Download it.
JavaScript file written in CoffeeScript, a programming language that compiles and transcompiles to JavaScript; saved in a text format and contains code that is similar to JavaScript, but modified to be more readable. CoffeeScript's aim is to enhance JavaScript's brevity and readability.
Yes you can.
coffee source.coffee -n
It will run Node directly without generating any .js files.
Reference
Update: Coffee now also supports --nodejs
. The above does the same as
coffee source.coffee --nodejs
But yeah, -n
is way shorter.
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