I've been contemplating moving my project over to cloud 9 IDE but have been having trouble running coffee script in the project. I copied over all my js and coffee files but can't seem to get a run configuration working using the coffee files. I tried compiling the coffee files in the console command line as well as creating a run configuration that calls the app.coffee directly but no luck.
What is the coffee script support on cloud 9 and how does it work. Does it compile the coffee script to js automatically? How do I need to configure my run settings in cloud 9?
CoffeeScript is a programming language that compiles to JavaScript. It adds syntactic sugar inspired by Ruby, Python, and Haskell in an effort to enhance JavaScript's brevity and readability. Specific additional features include list comprehension and destructuring assignment.
I got it working... your results may vary, but this is what I did...
Assuming you have your app which is called app.coffee
, I created a file called runner.js
with the following code:
require("coffee-script");
require("./app");
From the Cloud9 IDE, I just tell it to run the runner.js
file and it seems to work.
I also wasn't able to use my global npm-installed packages... not sure why, but I am guessing it is just a pathing issue. Anyways, I just installed my packages into my project directory:
npm install coffee-script
I was also using express
and restler
in my project so I did the same thing in the project. It worked beautiffuly :)
There is an entry on the Cloud9 support page on running node.js applications written in CoffeeScript: Create a CoffeeScript node.js project. Note that you can only debug the javascript files.
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