Ndefault
Bun

namespace

console.default

  • interface Console

    • readonly Console: {new (stdout: WritableStream, stderr?: WritableStream, ignoreErrors?: boolean) => Console; new (options: ConsoleOptions) => Console}
    • condition?: unknown,
      ...data: any[]
      ): void;
    • clear(): void;
    • label?: string
      ): void;
    • label?: string
      ): void;
    • ...data: any[]
      ): void;
    • item?: any,
      options?: InspectOptions
      ): void;
    • ...data: any[]
      ): void;
    • ...data: any[]
      ): void;
    • ...data: any[]
      ): void;
    • ...data: any[]
      ): void;
    • groupEnd(): void;
    • ...data: any[]
      ): void;
    • ...data: any[]
      ): void;
    • label?: string
      ): void;

      This method does not display anything unless used in the inspector. The console.profile() method starts a JavaScript CPU profile with an optional label until profileEnd is called. The profile is then added to the Profile panel of the inspector.

      console.profile('MyLabel');
      // Some code
      console.profileEnd('MyLabel');
      // Adds the profile 'MyLabel' to the Profiles panel of the inspector.
      
    • label?: string
      ): void;

      This method does not display anything unless used in the inspector. Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector. See profile for an example.

      If this method is called without a label, the most recently started profile is stopped.

    • tabularData?: any,
      properties?: string[]
      ): void;
    • label?: string
      ): void;
    • label?: string
      ): void;
    • label?: string,
      ...data: any[]
      ): void;
    • label?: string
      ): void;

      This method does not display anything unless used in the inspector. The console.timeStamp() method adds an event with the label 'label' to the Timeline panel of the inspector.

    • ...data: any[]
      ): void;
    • ...data: any[]
      ): void;
  • interface ConsoleOptions

    • colorMode?: boolean | 'auto'

      Set color support for this Console instance. Setting to true enables coloring while inspecting values. Setting to false disables coloring while inspecting values. Setting to 'auto' makes color support depend on the value of the isTTY property and the value returned by getColorDepth() on the respective stream. This option can not be used, if inspectOptions.colors is set as well.

    • groupIndentation?: number

      Set group indentation.

    • ignoreErrors?: boolean

      Ignore errors when writing to the underlying streams.

    • inspectOptions?: InspectOptions | ReadonlyMap<WritableStream, InspectOptions>
    • stderr?: WritableStream
    • stdout: WritableStream