1.8.0 • Published 4 years ago
tinytag v1.8.0
tinytag
A set of useful template literal tag functions.
Installation
npm i --save tinytag
Usage
// Node.js
const tinyTag = require('tinytag');
// Browser
import tinyTag from 'tinytag';
// or
import { methodName } from 'tinytag'
Methods
- highLightTag
Wraps each template variable in string literal with <span class=highlight> <span>
to highlight variables in string.
Example:
highLightTag`Current account balance ${100000} no ${'overdraft'}` // => 'Current account balance <span class=highlight> 1000000 <span> no <span class=highlight> overdraft <span>'