Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
150 views
in Technique[技术] by (71.8m points)

javascript - 我可以为node.js使用CoffeeScript而不是JS吗?(Can I use CoffeeScript instead of JS for node.js?)

What are my restrictions if I want to code node.js and use CoffeeScript?(如果我想编写node.js并使用CoffeeScript,我的限制是什么?)

Can I do anything I'd be able to do in JS?(我可以做任何我能用JS做的事吗?)   ask by donald translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Yes, CoffeeScript simply compiles into pure JS, making it completely compatible with node.js.(是的,CoffeeScript只是编译成纯JS,使其与node.js完全兼容。)

To run CoffeeScripts on node, you can either:(要在节点上运行CoffeeScripts,您可以:) Type coffee -c example.coffee to compile, followed by node example.js to run the compiled JS.(键入coffee -c example.coffee进行编译,然后输入node example.js来运行已编译的JS。) Simply type coffee example.coffee(只需键入coffee example.coffee)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...