any-template-compiler

0.1.7 • Public • Published

any-template-compiler

编译器 使用方法 输入:一个模板文件,有特定的语法 输出:编译后的内容

语法

// <%% %%> 用于转义 // <% 脚本 // <%= 输出脚本值 // <%- 输出脚本值,unescape

使用

import renderTemplate from 'any-template-compiler'

let ret = renderTemplate('<html><body>title<%= title%><div><%- html%></div></body></html>',{title:'hello',html:'<div></div>'})

console.log(ret)

Readme

Keywords

Package Sidebar

Install

npm i any-template-compiler

Weekly Downloads

3

Version

0.1.7

License

none

Unpacked Size

3.64 MB

Total Files

74

Last publish

Collaborators

  • lizs