Had a look at coffee-script, really cool just wanted to give it a try .
The command-line version of coffee is available as a Node.js utility.
The coffeescript code is compiled  into JavaScript and the number of lines we write is less than javascript code.

node.js Installation

Installing from source
gunzip node-v0.1.96.tar.gz
tar -xf node-v0.1.96.tar
cd node
./configure
make
sudo make install
After installtion try some simple javascripts in terminal

suren@suren-laptop:~$ node
 > 1+2
3
> function add(a,b) {
… return a + b;
… }
> add(1,2);
3

Coffee-script Installation

Source from Github
Navigate to the source path then 

sudo bin/cake install

After installation try open your terminal

suren@suren-laptop:~$ coffee
coffee> coffee = true
true
coffee> console.log(“coffee-script installed”) if coffee
coffee-script installed
coffee> 

Create a file with  .coffee extension

hello_coffee.coffee

hello = true
console.log “Hello World!” if hello
console.log(language.toUpperCase()) for language in [‘ruby’, ‘javascript’, ‘coffeescript’]

In the above code we have an array and iterating through that array using for loop.

Goto terminal and try running the hello_coffee file

suren@suren-laptop:~$ coffee hello_cofee.coffee 
 Hello World!
RUBY
JAVASCRIPT
COFFEESCRIPT
Advertisements