Question: Is there a way to get [ES6](https://github.com/lukehoban/es6features) in [sails.js](http://sailsjs.org/)?

Answer: 
SailsJS is just a framework written via ES5 syntax and it doesn't need to support ES6.

You can write project with ES6 syntax as you usually do and use Babel\Traceur\whatever for running.

My flow is following:

* Create Sails project;
* Install `babel` as `devDependencies`;
* Update `npm start` script in `package.json` with `"start": "babel-node app.js"`;

That's it. I can write ES6\7 code in my controllers\models\etc and run the server via `npm start` command. It works as usual as you wrote it with ES5 syntax.

[Babel Transpiler](https://babeljs.io)

[Babel Node](https://babeljs.io/docs/usage/cli/#babel-node)
You need to check compatibility of ES6 with node.js instead any framework like sails.js, express etc.

Because at last node.js will change the javaScript to server side code.
So it doesn't matter which framework you are using.

> 
> You can use the sails with ES6:
> 
> 
> 

For ES6 compatibility check [kangax.github.io](https://kangax.github.io/compat-table/es6/).

Recommended :

> 
> [Sails](http://sailsjs.org/) v 0.11.0 or greater
> 
> 
> [Node](https://nodejs.org/en/download/) v 4.*.* or greater 
> 
> 
> [npm](https://www.npmjs.com/) v 2.14.4 or greater 
> 
> 
> 

Now you are ready to explore new [Ecmascript6](https://developer.mozilla.org/en/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla) feature.

You will get the new feature from [http://es6-features.org/](http://es6-features.org/#Lexicalthis).

TEST :

Code:

```
ecma6Test:function(req,res,next){
    var evens =req.body.evens
    odds  = evens.map(v => v + 1);
    res.json({sucess:true,'odds':odds});
}

```

Request:

```
{"evens":[2,4,6,8,10]}

```

Response :

```
{
    "sucess": true,
    "odds":[3, 5, 7, 9, 11]
}

```