nunjs

Nunjucks wrapper, adds Jinja2 engine for Sails/Express in a simplest way.

npm install nunjs
7 downloads in the last week
8 downloads in the last month

nunjs

Nunjucks wrapper, adds Jinja2 engine for Sails/Express in a simplest way.

Sails is great! But it's absolutly unconfigurable. There are only two template engines to choose - ejs and jade. I hate them both. Jinja is simplier and better for me. I'm sure you are lazy like me and prefer to use powerful modules ready-to-use, without voodoo practices.

Important!

This module is a patch for sails.js version 0.9.4 and earlier. For newest versions, you can fully use consolidated nunjucks module

Install

Basic

$ npm install nunjs 

From GitHub

$ npm install git://github.com/rootStar-lock/nunjs.git

Usage

It is simple, very simple. Just install and config your app.

Express

Add/change your app.js file like:

app.set('views', __dirname + '/views');
app.set('view engine', 'nunjs');
app.use(express.favicon());

Sails

Change your engine option in config/views.js to nunjs

module.exports.views = {
    engine: 'nunjs',
    layout: true //Ingnored. Use extends command http://jinja.pocoo.org/docs/templates/#template-inheritance
}

Next ?

After that add your .nunjs templates in your views folder.

Contacts

  • Email: deneb808@gmail.com

My own luna park with nuns and chess :) Enjoy

npm loves you