CoffeeScript is an feature-rich, versatile and common JavaScript preprocessor. CoffeeScript is a white space sensitive variant of JavaScript.


Harp includes the best-of-breed preprocessors by default. This means you don’t need to waste time configuring CoffeeScript, worrying about installing dependencies, minifying your JavaScript, or even selecting the input and output location for files. Everything just works.


Harp’s Asset Pipeline is super easy to use. All the processing happens implicitly, so there is nothing to setup. Just name your file with an .coffee extension instead of .js and the Harp web server will see it as if it is a .js file.


In this project, there is an file in the js directory, like so:

  |- index.html
  +- js/

Now, you would simply reference app.js in index.ejs as you would with any other JS file:

        <!-- Here we reference a JS file that is auto generated -->
        <script src="js/app.js"></script>

And your could use CoffeeScript like this:

mass = 72
height = 1.78
BMI = mass/Math.pow height, 2
alert 'You are healthy!' if 18.5<BMI<25

Also see