Documentation
    Preparing search index...

    Dumper exposes the API to dump or die/dump values in your AdonisJS application. An singleton instance of the Dumper is shared as a service and may use it follows.

    const dumper = container.make('dumper')

    dumper.configureHtmlOutput({
    // parser + html formatter config
    })

    dumper.configureAnsiOutput({
    // parser + console formatter config
    })

    const html = dumper.dumpToHtml(value)
    const ansi = dumper.dumpToAnsi(value)

    // Returns style and script tags that must be
    // injeted to the head of the HTML document

    const head = dumper.getHeadElements()
    Index

    Constructors

    Methods

    • Configure the HTML formatter output

      Parameters

      • config: HTMLDumpConfig

      Returns this

    • Configure the ANSI formatter output

      Parameters

      • config: ConsoleDumpConfig

      Returns this

    • Returns the style and the script elements for the HTML document

      Parameters

      • OptionalcspNonce: string

      Returns string

    • Dump value to HTML ouput

      Parameters

      • value: unknown
      • options: {
            cspNonce?: string;
            title?: string;
            source?: { location: string; line: number };
        } = {}

      Returns string

    • Dump value to ANSI output

      Parameters

      • value: unknown
      • options: { title?: string; source?: { location: string; line: number } } = {}

      Returns string

    • Dump values and die. The formatter will be picked based upon where your app is running.

      • During an HTTP request, the HTML output will be sent to the server.
      • Otherwise the value will be logged in the console

      Parameters

      • value: unknown
      • traceSourceIndex: number = 1

      Returns void