Options
All
  • Public
  • Public/Protected
  • All
Menu

string-template-format-json — Reference

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

Generated using TypeDoc