O'Reilly logo

CoffeeScript Programming with jQuery, Rails, and Node.js by Michael Erasmus

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

node-supervisor

By now, you might be wondering if you'll need to restart our Node application each time we make a change to our code. Ideally in development, we would like our code to be reloaded automatically each time we make a change, similar to how it works in Rails.

Luckily, there is a neat, open source library that we can use that does exactly that: node-supervisor (https://github.com/isaacs/node-supervisor). We install it like any other npm module, we just make sure to pass the -g flag to install it globally, as shown in the following command:

npm install supervisor -g

In the terminal, you should now be able to run the supervisor by using the following command:

supervisor app.coffee

Keep this process running in a separate window. To see if ...

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