Interpret JavaScript tagged literal templates
npm install @vanillaes/interpolateA small, easy-to-use template literal builder. Good for loading template literal strings from external sources.
- ECMAScript Module
- Typescript Compatible
- Tiny Footprint (1K)
This package works isomorphically in browser and server-side JavaScript
Import directly from the local path or a CDN
``html`
The minified version can be imported from
`html`
Install the package
`sh`
npm install @vanillaes/interpolate
Import using the module path
`javascript`
import { interpolate } from '@vanillaes/interpolate'
Builds a string from a template string + tags collection.
`Interpolate(template, {tags})``
- template - the template literal string
- tags - the tagged values in the template
Typings are generated from JSDoc using Typescript. They are 100% compatible with VSCode Intellisense and will work seamlessly with Typescript.