npm install mito> micro-templating function
This is forked from John Resig's micro-templating.
Just 222B minified.
Similar to .ejs
``ejs`
<% items.forEach(function (item) { %>
<% }) %>
With the above string, the following renders it.
`js`
mito(above)({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'}
]})
``
npm install mito
`js``
var mito = require('mito')
- @param {String} str The template string
Returns template function compiled with the given template string.
- @param {Object} obj The template parameter
Returns the rendered string with template parameter
- 222B minified
- No dependency
- No cache mechanism
- No include/import/require support
- Line breaks become whitespace (0x20)
MIT