O'Reilly logo

CoffeeScript Application Development by Ian Young

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using CoffeeScript with Node.js

Node.js is an environment that runs JavaScript on the server side. We're already using it to run our CoffeeScript compiler! However, Node is also popular for running server applications. It should be no surprise, then, that we can configure server-side Node applications to compile CoffeeScript for client-side code.

We'll build a simple server using Express, a popular MVC framework for Node. To compile our CoffeeScript, we'll use a Node package that provides an asset pipeline. This is some code that takes assets, such as scripts and style sheets, and compiles and prepares them for consumption by a browser. Once we have that set up, we'll port our pet shop application to try it out.

Even though we'll be detailing the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required