simplet

Simple Template Engine

simpleT 0.1.2

simpleT is a simple template engine for Node.JS and web browsers that has some special features:

  • Simple structure with minimum configuration
  • Embedded JavaScript support
  • Client-side support
  • High performance
  • Customizable code delimiters
  • Global values injection
  • Dynamic caching
  • Includes
  • Result without redundant whitespace

Documentation

npm install simplet
var simplet = require('simplet');
 
/* ***template.ejs***
 
Hello <% print(name) %>
 
*/
 
var fileEngine = simplet();
 
fileEngine.render('template.ejs', {
    name: 'me'
});
 
/* ***output***
 
Hello me
 
*/
  • code isolation <% code %>
  • data printing <%= data %> or <% print(data) %>
  • includes <%# template %> or <% include(template) %>