giodamelio
giodamelio

Reputation: 5605

NodeJS + CoffeeScript Workflow

I have recently started learning nodeJS. Being a long-time coffeescript lover I naturally decided to use it along with node. Writing long-running processes with node I found myself restarting the program frequently. After a quick google I found node-supervisor. Node-supervisor simply watches the current directory for file changes and restarts your app for you automatically.

Before I started using supervisor I was using coffeescript with the --watch option to automatically recompile my coffescripts when they changed.

So the problem is this, supervisor and the coffeescript recompiler don't play nice together.

After that supervisor keeps restarting my app forever, even when there has been no changes to the source files.

So the question is this, what is your workflow for working with nodeJS and CoffeeScript?

Upvotes: 5

Views: 1690

Answers (1)

TheHippo
TheHippo

Reputation: 63139

What you are doing is some kind of redundant.

Here are some hints:

  • after installing CoffeeScript you have an executable called coffee so you can do (no need to compile your coffee-script files):

    coffee yourfile.coffee

  • how to combine this with supervisor?
    if you would have read the Readme on the Github page you would have noticed that supervisor can execute CoffeeScript files, too. All you need to do is:

    supervisor yourfile.coffee

Upvotes: 8

Related Questions