Nodemon in Node.js / io.js projects with ES6 / ES7

If for some reason you don’t want to use Grunt or Gulp in your Node.js / io.js project utilizing ES6 and ES7 (ECMAScript 6 and 7) features, you can configure automatic Traceur compilation with nodemon:

  1. install Traceur Runner (Traceur will be installed automatically as a dependency):

    1
    npm install -g traceur-runner
  2. force nodemon to use Traceur Runner for all JavaScript files and to watch for changes in js, json, html, css files by creating nodemon.json file:

    1
    2
    3
    4
    5
    6
    {
    "execMap": {
    "js": "traceur-runner"
    },
    "ext": "js json html css"
    }

Now it is possible to develop and run Node.js / io.js projects utilizing ES6 / ES7 features using nodemon with automatic traceur JavaScript.next-to-JavaScript-of-today compilation on the fly.