如何在咖啡脚本中编写这些表达式?

时间:2014-05-26 22:22:27

标签: node.js coffeescript

我正在尝试将javascript应用程序重写为coffee脚本。虽然,我找不到如何转换这两个表达式(我添加了我尝试过的内容)。你能帮帮我吗?

var config = require(path.join(__dirname, 'configs'))[env];
(What I tried) : config = require path.join __dirname, 'configs'[env]

server.use(require('node-compass')({mode: 'expanded'}));
(What I tried) : server.use require 'node-compass (
    mode: 'expanded'
)

感谢您的帮助!

1 个答案:

答案 0 :(得分:1)

config = require(path.join(__dirname, 'configs'))[env]
server.use(require('node-compass') mode: 'expanded')