Javascript micro-templating for NodeJS.

npm install mtmpl
4 downloads in the last week
8 downloads in the last month


Simple JavaScript templating for NodeJS

Based heavily on John Resig's micro-templating.


$ npm install mtmpl


var mtmpl = require("mtmpl");

// 'Hello, my name is John!'
var html = mtmpl.mtmpl("Hello, my name is <>!",{name:"John"});

// A reusable template function.
var tmplFunc = mtmpl.mtmpl("Hello, my name is <>!");

// 'Hello, my name is Bob!'
var html1 = tmplFunc({name:"Bob"});

// 'Hello, my name is Jim!'
var html2 = tmplFunc({name:"Jim"})

// A reusable template function as a string.
var precompiled = mtmpl.precompile("Hello, my name is <>!");

Tests Build Status

$ npm test
npm loves you