console

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2023 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const ModuleName = "console"

Variables

This section is empty.

Functions

func Enable

func Enable(runtime *goja.Runtime)

func Require

func Require(runtime *goja.Runtime, module *goja.Object)

func RequireWithPrinter

func RequireWithPrinter(printer Printer) require.ModuleLoader

Types

type Console

type Console struct {
	// contains filtered or unexported fields
}

type Printer

type Printer interface {
	Log(string)
	Warn(string)
	Error(string)
}

type StdPrinter

type StdPrinter struct {
	StdoutPrint func(s string)
	StderrPrint func(s string)
}

StdPrinter implements the console.Printer interface that prints to the stdout or stderr.

func (StdPrinter) Error

func (p StdPrinter) Error(s string)

Error prints s to the stderr.

func (StdPrinter) Log

func (p StdPrinter) Log(s string)

Log prints s to the stdout.

func (StdPrinter) Warn

func (p StdPrinter) Warn(s string)

Warn prints s to the stderr.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL