Welcome to OStack Knowledge Sharing 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 - Can I use CoffeeScript instead of JS for node.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?

See Question&Answers more detail:os

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

1 Answer

0 votes
by (71.8m points)

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

To run CoffeeScripts on node, you can either:

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...