underscore.template
Extracted template from Underscore, use _.template
without full underscore source.
Installation
NPM
npm install underscore.template
Bower
bower install underscore.template
Usage
Node.js
var UnderscoreTemplate = require('underscore.template');
var template = UnderscoreTemplate("<b><%- value %></b>");
template({value: 'hello world'});
template({value: '<script>'});
Browser
Simply download the latest minified version from the dist/
folder. API is available in a global object called UnderscoreTemplate
.
<script src="./dist/underscore.template.js"></script>
var template = UnderscoreTemplate("<b><%- value %></b>");
template({value: 'hello world'});
Testing
npm test
License
MIT, see the LICENSE file for detail.