pencil-mustache
Simple mustache-style string interpolation.
pencil-mustache is an ultra-minimal mustache-style interpolation micro library. It only implements simple interpolation of double and triple-mustache placeholder expressions (the former being escaped). No pre-compiling. No caching. No partials. No helpers.
Installation
Install using npm:
$ npm install pencil-mustache
Usage
Given the following HTML string:
{{headline}} {{{description}}}
and this context:
headline: 'Fish & Chips' description: '<span>A house specialty!</span>'
results in:
Fish & Chips A house specialty!
All together:
var mustache = html = context = headline: 'Fish & Chips' description: '<span>A house specialty!</span>' template = ; documentinnerHtml = ;
Changelog
1.1.0
- Changed: replace
undefined
andnull
with empty string
1.0.0
- Initial release
License
MIT