# console

An implementation of the console global on top of WASI. Requires a WASI-enabled host and opting into WASI in the entry file with

import "wasi";

# Static members

  • function assert<T>(assertion: T, message?: string): void
    

    Logs message to console if assertion is false-ish.

  • function log(message?: string): void
    

    Outputs message to the console.

  • function debug(message?: string): void
    function info(message?: string): void
    function warn(message?: string): void
    function error(message?: string): void
    

    Outputs message to the console, prefixed with "Debug:", "Info:", "Warning:" or "Error:" respectively.

  • function time(label?: string): void
    

    Starts a new timer using the specified label.

  • function timeLog(label?: string): void
    

    Logs the current value of a timer previously started with console.time.

  • function timeEnd(label?: string): void
    

    Logs the current value of a timer previously started with console.time and discards the timer.