string-template-format-json
TypeScript icon, indicating that this package has built-in type declarations

0.1.7 • Public • Published

String Template Format: JSON

String template literal tag that converts values to JSON text

Usage

import json from 'string-template-format-json'
console.log(json`number ${123}; string: ${'abc'}; object: ${{ abc: 123 }}; array: ${[0, 1, 2]}`)

should print:

number: 123; string: "abc"; object: {"abc":123}; array: [0,1,2]

License

MIT © Hoàng Văn Khải

Package Sidebar

Install

npm i string-template-format-json

Weekly Downloads

1

Version

0.1.7

License

MIT

Unpacked Size

2.4 kB

Total Files

5

Last publish

Collaborators

  • khai96_