user1437328
user1437328

Reputation: 15846

Processing Coffeescript code in Node.js

How can i process a coffeescript code directly into javascript in node.js ?

maybe i could use the coffee compiler using child_process.exec/spawn/fork but is there a direct way ? like loading a library (that ships with the coffee package when it's installed with npm) and passing code to it, that returns the compiled code directly ?

Upvotes: 2

Views: 263

Answers (2)

david
david

Reputation: 18258

You can do npm install coffee-script and then just put var coffee = require('coffee-script'); to get access to the coffee.compile function which will do what you want.

Upvotes: 4

jiten
jiten

Reputation: 1

did you have a look at Express? It supports coffeekup template engine too.

Upvotes: -1

Related Questions