liuz-wxapp-template
v0.0.2
Published
A simple template for wxapp, mimicing `lodash.template` api.
Downloads
1
Readme
wxapp-template
A simple template for wxapp, mimicing lodash.template
api. It supports following syntax:
<%= variable %>
print out raw variable<%- variable %>
html escape variable<% if (variable) { %> XXX <% } %>
evaluate condition based on variable
Install
$ npm install liuz-wxapp-template
Usage
const template = require('liuz-wxapp-template');
var tpl = 'Hello <%= username %>!';
var data = {
username: 'Spiderman',
}
console.log(template(tpl)(data));