The recommended language for building Node.js+Sails apps is JavaScript.
But Sails also supports using CoffeeScript to write your custom app code (like actions and models). You can enable this support in three steps:
npm install coffee-script --save
in your app folder.app.js
file:require('coffee-script/register');
node app.js
instead of sails lift
.If you want to use CoffeeScript to write your controllers, models or config files, just follow these steps:
npm install --save-dev sails-generate-controller-coffee sails-generate-model-coffee
--coffee
when using one of the supported generators from the command-line:sails generate api <foo> --coffee
# Generate api/models/Foo.coffee and api/controllers/FooController.coffee
sails generate model <foo> --coffee
# Generate api/models/Foo.coffee
sails generate controller <foo> --coffee
# Generate api/controllers/FooController.coffee