我可以使用CoffeeScript而不是JS的node.js吗? [英] Can I use CoffeeScript instead of JS for node.js?

查看:111
本文介绍了我可以使用CoffeeScript而不是JS的node.js吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我想编写node.js并使用CoffeeScript,我的限制是什么?
我可以在JS中做任何事吗?

What are my restrictions if I want to code node.js and use CoffeeScript? Can I do anything I'd be able to do in JS?

推荐答案

是的,CoffeeScript只是编译成纯JS,使其与node.js完全兼容。

Yes, CoffeeScript simply compiles into pure JS, making it completely compatible with node.js.

要在节点上运行CoffeeScripts,您可以:

To run CoffeeScripts on node, you can either:


  • 输入 coffee -c example.coffee 以编译,然后运行 node example.js 以运行编译的JS。

  • 只需键入 coffee example.coffee

  • Type coffee -c example.coffee to compile, followed by node example.js to run the compiled JS.
  • Simply type coffee example.coffee

这篇关于我可以使用CoffeeScript而不是JS的node.js吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆