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

0.1.8 • Public • Published

String Template Format: Inspect

String template literal tag that uses Node's util.inspect

Usage Examples

Without Options

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 ]

With Options

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 ] }

License

MIT © Hoàng Văn Khải

/string-template-format-inspect/

    Package Sidebar

    Install

    npm i string-template-format-inspect

    Weekly Downloads

    0

    Version

    0.1.8

    License

    MIT

    Unpacked Size

    4.76 kB

    Total Files

    5

    Last publish

    Collaborators

    • khai96_