variabletag

Like template literals, but for strings and custom variables.

Usage no npm install needed!

<script type="module">
  import variabletag from 'https://cdn.skypack.dev/variabletag';
</script>

README

VariableTag

Like template literals, but for user inputted strings and custom variables.

Install

npm i variabletag

Example

const VariableTag = require('variabletag');
const vt = new VariableTag({
    tags: {
        'user': 'sammy',
        'punctuation': '!'
    }
});

const text = vt.format('Hello %user%%punctuation%');
console.log(text);