console

package
v0.0.0-...-b481721 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: MIT Imports: 5 Imported by: 228 modules, 210 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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