@seregpie/tag
v1.0.0
Published
Parses a template literal to a function.
Maintainers
Readme
tag
Parses a template literal to a function.
setup
npm
npm i @seregpie/tagImport inside an ES module.
import tag from '@seregpie/tag';or
Import inside a CommonJS module.
let tag = require('@seregpie/tag');browser
<script src="https://unpkg.com/@seregpie/tag"></script>The function is globally available as tag.
usage
let renderTemplate = tag`Hi, ${'name'}!`;
let string = renderTemplate({name: 'Patrik'});
// => 'Hi, Patrik!'