@stacktrace-lite/core
    Preparing search index...

    Type Alias NodeHookOptions

    Options for installNodeErrorHooks.

    When a fatal error occurs in Node.js (an uncaught exception or an unhandled promise rejection), the stack is parsed into StackFrame objects, optionally filtered and formatted, then either passed to NodeHookOptions.onStack or printed (pretty) to stderr.

    type NodeHookOptions = {
        filter?: Parameters<typeof filterStack>[1];
        format?: Parameters<typeof formatStack>[1];
        onStack?: (frames: StackFrame[], error: Error) => void;
    }
    Index

    Properties

    filter?: Parameters<typeof filterStack>[1]

    Filter configuration passed to filterStack.

    Same shape as the second argument of filterStack (e.g. include, exclude, and preset: 'app-only' to trim node_modules/internals).

    format?: Parameters<typeof formatStack>[1]

    Format configuration passed to formatStack.

    Select the output mode (e.g. 'cli') appropriate for terminals/log sinks.

    onStack?: (frames: StackFrame[], error: Error) => void

    Callback invoked with processed frames and the originating Error.

    Type declaration

      • (frames: StackFrame[], error: Error): void
      • Parameters

        • frames: StackFrame[]

          The parsed and (optionally) filtered stack frames.

        • error: Error

          The original Error instance.

        Returns void

    Use this to forward telemetry or trigger graceful shutdown logic. If omitted, a formatted stack is written to stderr.