1.0.1 • Published 6 years ago
gap-front-tpl v1.0.1
Gap Front Tpl
Install
$ yarn add gap-node-tpl
Usage
import {tpl, escapeHtml, scriptJson} from 'gap-front-tpl';
escapeHtml('<p>hello</p>'); //'<p>hello</p>'
scriptJson({k1: 'v1'}); // '<script type="text/javascript">{"k1":"v1"}</script><div class="data-rendering"></div>'
tpl`
<div>
<h1>Gap Front Tpl</h1>
<pre>$${'<code>coding here</code>'}</pre>
</div>
`
/*
<div> <h1>Gap Front Tpl</h1> <pre><code>coding here</code></pre> </div>
*/