otiai10 / micro-templating

Thank you http://ejohn.org/blog/javascript-micro-templating/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

micro-templating

Build Status

Respecting micro-templating

why

  • Want to use micro-templating on memory
  • Want to find tmpl string by NOT document.getElementById(tpl_name) BUT pool[tpl_name]

spec

// you can generate this pool by using `gulp-micro-templating`
this.MicroTemplates = {"foo":"<a href=\"<%= url %>\"><%= name %></a>"};

var tmpl = require('micro-templating').tmpl;

var html = tmpl("foo", {url:"https://npmjs.org/~otiai10", name:"otiai10"});
// == <a href="https://npmjs.org/~otiai10">otiai10</a>

About

Thank you http://ejohn.org/blog/javascript-micro-templating/


Languages

Language:JavaScript 100.0%