2011-09-26 38 views

回答

3

约片断我用:

var fs = require('fs') 
var coffee = require('coffee-script') 

// If you'd like to see compiled code.. 
// console.log(coffee.compile(fs.readFileSync('coffee.coffee'))) 

// ..otherwise 
fs.writeFileSync('output.js', coffee.compile(fs.readFileSync('input.coffee'))) 

..assumes你当然有安装coffee-script节点模块中。

从这个Cakefile我的翻译。

+0

我已经有了一起来看看咖啡.compile()方法,但我不知道是否有办法不使用FS。 无论如何,谢谢,我会用这个片段! – odino

相关问题