string-template-format-tostring

String template literal tag that converts any value that has .toString() method to strings

Usage no npm install needed!

<script type="module">
  import stringTemplateFormatTostring from 'https://cdn.skypack.dev/string-template-format-tostring';
</script>

README

String Template Format: toString

String template literal tag that converts any value that has .toString() method to strings

Usage

import str from 'string-template-format-tostring'
console.log(str`string: ${'abc'}; number: ${123}; function: ${Function};`)

should print:

string: abc; number: 123; function: function Function() { [native code] };

License

MIT © Hoàng Văn Khải