npm.io
0.1.7 • Published 6 years ago

string-template-format-base

Licence
MIT
Version
0.1.7
Deps
2
Size
3 kB
Vulns
0
Weekly
0
Stars
10

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

Keywords