ubuntu12.04 安装CoffeeScript

1、安装node.js(采用package manager来安装)

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm

2、安装coffee-script

sudo npm install -g coffee-script

-g参数可以让你全局的使用coffee-script

3、测试CoffeeScript

test.coffee

square = (x) -> x*x
cube = (x) -> square(x) * x
alert cube(3)

编译coffee-script

coffee --compile test.coffee

你可能感兴趣的:(ubuntu12.04 安装CoffeeScript)