string-template-format-base

Create string template tag that transform values into strings

Usage no npm install needed!

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

README

String Template Format: Base

Create string template tag that transform values into strings

Usage

import tag from 'string-template-format-base'
const myTag = tag(value => `[${typeof value} ${value}]`)
console.log(myTag`${123}; ${'abc'}; ${{ abc: 123 }}; ${[0, 1, 2]}`)

should print:

[number 123]; [string abc]; [object [Object object]]; [array 0,1,2]

License

MIT © Hoàng Văn Khải