I'm using Node.js and wanting to incorporate CoffeeScript into my workflow. I have two use-cases:
- I want to be able to write JavaScript files which
require()
CoffeeScript modules
- I want to be able to load CoffeeScript modules from within the node REPL
For case #1: I can just compile from .coffee
to .js
and require()
the .js
module, as a workaround.
For case #2: Right now I'm eval()
ing the output of coffee-script.compile()
.
Is there a better, more unified way to do this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…