NodeJS + CoffeeScript Workflow

I recently started learning nodeJS. Being a coffeescript lover for a long time, I naturally decided to use it with node. Writing lengthy processes with node I often restarted the program. After a quick google, I found node-supervisor . Node -supervisor simply scans the current directory for file changes and automatically launches your application for you.

Before I started using the supervisor, I used coffeescript with the option --watchto automatically recompile my coffescripts when they changed.

So the problem is that the supervisor and the coffeescript recompiler do not play together.

  • First i run coffee --compile --watch .
  • Then in the new terminal I run supervisor app.js

After that, the supervisor continues to restart my application forever, even if there were no changes in the source files.

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

+5
source share
1 answer

What you do is kind of redundant.

Here are some suggestions:

  • after installing CoffeeScript, you have an executable file with the name coffee, so you can do it (there is no need to compile files for the coffee script):

    coffee yourfile.coffee

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

    supervisor yourfile.coffee

+8
source

All Articles