How to setup Nunjucks as the template engine of a Sails JS application

Nunjucks is a template engine build by Mozilla and it has a lot of functionality, for example, asynchronous control, filters, extensions, and many others. One of the most important features for me is template inheritance. That’s why I decided to use it in a Sails application that I’m building.

First things first. Install Nunjucks and Consolidate, which is the glue between Nunjucks and Sails.

npm install consolidate nunjucks --save