Skip to content

jethrolarson/zentmpl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

zentmpl

Adapted from http://ejohn.org/blog/javascript-micro-templating/

MIT or GPL Version 2 licenses. Like jQuery http://jquery.org/license

Examples

var tm = "Hello, {%=this.name%}";
var data = {"name":"jethro"};

Most performant for repeated use

var hiTemplate = zentmpl(tm);
hiTemplate(data);

Single Use

zentmpl(tm)(data);

Use with jQuery

$("ul").html(hiTemplate(data));

One-liner with jquery

$("ul").html(zentmpl("Hello, {%=this.name%}")({"name":"jethro"}));

As jquery plugin

$.tmpl = zentmpl;

About

super simple javascript template

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published