String template literal tag that uses Node's util.inspect
import { dbg } from 'string-template-format-inspect'
console.log(dbg`number ${123}; string: ${'abc'}; object: ${{ abc: 123 }}; array: ${[0, 1, 2]}`)
should print:
number: 123; string: 'abc'; object: { abc: 123 }; array: [ 0, 1, 2 ]
import { InspectFormatter } from 'string-template-format-inspect'
const dbg = InspectFormatter({ getters: true, maxArrayLength: 0 })
const myObject = { get abc () { return 123 }, def: [0, 1, 2] }
console.log(dbg`my object is ${myObject}`)
should print:
my object is { abc: [Getter: 123], def: [ ... 3 more items ] }
Generated using TypeDoc