tagged-template-escape

Customizable escaping for es6 tagged template strings

Usage no npm install needed!

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

README

tagged-template-escape

Customizable escaping for es6 tagged template strings

Get it

npm install --save tagged-template-escape

Escape stuff

import templateEscaper from 'tagged-template-escape';

let urlEscape = templateEscaper(encodeURIComponent);

let somethingEvil = '\uD800\uDFFF';

window.location.href = urlEscape`http://mysite.com/?var=${somethingEvil}`;