skin-template

A template engine built on the top of ES6 template literals syntax and Google IncrementalDOM.

Usage no npm install needed!

<script type="module">
  import skinTemplate from 'https://cdn.skypack.dev/skin-template';
</script>

README

Logo

A template engine built on the top of ES6 template literals syntax and Google IncrementalDOM.

Install

NPM

$ npm i skin-template --save

Bower

$ bower i skin-template --save

Quick use

Import the library:

<script src="path/to/skin-template.js"></script>

Bootstrap a template:

var template = new Skin('name', 'age', ' \
    <div class="card"> \
        <span class="user-name">${name}</span> \
        <span class="user-age">${age}</span> \
    </div> \
');

template.render(document.body, 'Alan', 11);

Limitations

  • At the moment, only html wrapped by "`" (backtiks) is supported. Any other string will be ignored by the compiled and treat as function statement.
  • If you are targeting ES5 browsers, remember that the template string will not be transpiled during your build process.

Dev

Travis Code coverage

Sauce Test Status