How to use generators support in Heroku

The use of Javascript has increased and the projects are getting more complex. The EcmaScript 6 brings many new features into languages that should make the development easier and make the Javascript ecosystem richer. Currently you could use some of the features on the server side with Node.js newer versions like 0.11. There isn’t many hosting services where you could select the running node engine. Luckily, Heroku has this support for this, there is nice site for versions.


As you could see the version 0.11.12 is unstable but still you could use it. Lets assume you have already setup the project, now change the package.json, node property set it to ~0.11.

  "name": "myapp",
  "description": "a really cool app",
  "version": "0.0.1",
  "engines": {
    "node": "~0.11"
  "dependencies": {
    "co": "^3.0.5"
web: node --harmony server.js

The last step is to change the Procfile and add the –harmony flag. So the file should look something like this. This enables only small part of the ES6 functionality.