Skip to main content
Latest
class Console
import { Console } from "https://deno.land/x/adka_server@0.1.5/deno.d.ts";

Properties

assert: (condition?: boolean, ...args: unknown[]) => void

Writes an error message to stdout if the assertion is false. If the assertion is true, nothing happens.

ref: https://console.spec.whatwg.org/#assert

clear: () => void
count: (label?: string) => void
countReset: (label?: string) => void
debug: (...args: unknown[]) => void

Writes the arguments to stdout

dir: (obj: unknown, options?: Partial<{ depth: number; indentLevel: number; }>) => void

Writes the properties of the supplied obj to stdout

dirxml: (obj: unknown, options?: Partial<{ showHidden: boolean; depth: number; colors: boolean; indentLevel: number; }>) => void

From MDN: Displays an interactive tree of the descendant elements of the specified XML/HTML element. If it is not possible to display as an element the JavaScript Object view is shown instead. The output is presented as a hierarchical listing of expandable nodes that let you see the contents of child nodes.

Since we write to stdout, we can't display anything interactive we just fall back to console.dir.

error: (...args: unknown[]) => void

Writes the arguments to stdout

group: (...label: unknown[]) => void
groupCollapsed: (...label: unknown[]) => void
groupEnd: () => void
indentLevel: number
info: (...args: unknown[]) => void

Writes the arguments to stdout

log: (...args: unknown[]) => void

Writes the arguments to stdout

table: (data: unknown, properties?: string[] | undefined) => void
time: (label?: string) => void
timeEnd: (label?: string) => void
timeLog: (label?: string, ...args: unknown[]) => void
trace: (...args: unknown[]) => void
warn: (...args: unknown[]) => void

Writes the arguments to stdout

[isConsoleInstance]: boolean