Bun

namespace

inspect

function inspect(
arg: any,
): string;

Pretty-print an object the same as console.log to a string

Supports JSX

@param arg

The value to inspect

@param options

Options for the inspection

namespace inspect

  • That can be used to declare custom inspect functions.

  • function table(
    tabularData: object | unknown[],
    properties?: string[],
    options?: { colors: boolean }
    ): string;

    Pretty-print an object or array as a table

    Like console.table, except it returns a string

    function table(
    tabularData: object | unknown[],
    options?: { colors: boolean }
    ): string;

    Pretty-print an object or array as a table

    Like console.table, except it returns a string