stringify-tag

Template literal tag that properly stringifies all inputs.

Usage no npm install needed!

<script type="module">
  import stringifyTag from 'https://cdn.skypack.dev/stringify-tag';
</script>

README

stringify-tag

Template literal tag that properly stringifies all inputs.

Use

import stringify from 'stringify-tag';

const obj = {
  a: 1,
  b: 'hello'
};

stringify`My object: ${obj}`;
// >> "My object: {\"a\":1,\"b\":\"hello\"}"

Install

yarn add stringify-tag