Skip to content

theakman2/node-modules-mtmpl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-modules-mtmpl

Simple JavaScript templating for NodeJS

Based heavily on John Resig's micro-templating.

Installation

$ npm install mtmpl

Usage

var mtmpl = require("mtmpl");

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

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

// '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 <%=data.name%>!");

Tests Build Status

$ npm test

About

Simple JavaScript templating for NodeJS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published