mito v1.0.5
micro-templating function
This is forked from John Resig's micro-templating.
Just 222B minified.
Syntax
Similar to .ejs
<%= title %> <% items.forEach(function (item) { %> <%= item.name %> <% }) %>
With the above string, the following renders it.
title: 'Hello' items: name: 'Linux' url: 'https://github.com/torvalds/linux' name: 'XNU' url: 'https://github.com/opensource-apple/xnu' name: 'Hurd' url: 'https://www.gnu.org/software/hurd/hurd.html'
Install
npm install mito
API
var mito =
mito(str)
- @param {String} str The template string
Returns template function compiled with the given template string.
mito(str)(obj)
- @param {Object} obj The template parameter
Returns the rendered string with template parameter
Feature / Restriction
- 222B minified
- No dependency
- No cache mechanism
- No include/import/require support
- Line breaks become whitespace (0x20)
License
MIT