nx.js
Classes

Console

Constructors

new Console()

new Console(opts): Console

Parameters

ParameterType
optsConsoleOptions

Returns

Console

Methods

assert()

assert(condition?, ...args?): void

Logs the formatted input if condition is falsy.

Parameters

ParameterType
condition?boolean
...args?unknown[]

Returns

void

See

https://developer.mozilla.org/docs/Web/API/console/assert_static


clear()

clear(): void

Clears the console by printing the ANSI escape code for clearing the terminal.

Returns

void

See

https://developer.mozilla.org/docs/Web/API/console/clear_static


count()

count(label): void

Logs the number of times count() has been called with the given label.

Parameters

ParameterTypeDefault value
labelstring'default'

Returns

void

See

https://developer.mozilla.org/docs/Web/API/console/count_static


countReset()

countReset(label): void

Resets the counter for the given label.

Parameters

ParameterTypeDefault value
labelstring'default'

Returns

void

See

https://developer.mozilla.org/docs/Web/API/console/countReset_static


debug()

debug(...input): void

Writes the formatted input to the debug log file.

Tip

This function does not invoke text rendering mode, so it can safely be used when rendering with the Canvas API.

Parameters

ParameterType
...inputunknown[]

Returns

void


dir()

dir(item?): void

Displays an interactive listing of the properties of the specified object.

Parameters

ParameterType
item?unknown

Returns

void

See

https://developer.mozilla.org/docs/Web/API/console/dir_static


dirxml()

dirxml(item?): void

Alias for Console.dir.

Parameters

ParameterType
item?unknown

Returns

void

See

https://developer.mozilla.org/docs/Web/API/console/dirxml_static


error()

error(...input): void

Logs the formatted input to the screen as red text.

Parameters

ParameterType
...inputunknown[]

Returns

void


group()

group(...label): void

Creates a new inline group, indenting subsequent console messages.

Parameters

ParameterType
...labelunknown[]

Returns

void

See

https://developer.mozilla.org/docs/Web/API/console/group_static


groupCollapsed()

groupCollapsed(...label): void

Alias for Console.group.

Parameters

ParameterType
...labelunknown[]

Returns

void

See

https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static


groupEnd()

groupEnd(): void

Exits the current inline group.

Returns

void

See

https://developer.mozilla.org/docs/Web/API/console/groupEnd_static


info()

info(...input): void

Outputs a message at the "info" log level. Alias for Console.log.

Parameters

ParameterType
...inputunknown[]

Returns

void

See

https://developer.mozilla.org/docs/Web/API/console/info_static


log()

log(...input): void

Logs the formatted input to the screen as white text.

Parameters

ParameterType
...inputunknown[]

Returns

void


print()

print(s): void

Prints string s to the console on the screen, without any formatting applied. A newline is not appended to the end of the string.

Parameters

ParameterTypeDescription
sstringThe text to print to the console.

Returns

void


printErr()

printErr(s): void

Prints string s to the debug log file, without any formatting applied. A newline is not appended to the end of the string.

Tip

This function does not invoke text rendering mode, so it can safely be used when rendering with the Canvas API.

Parameters

ParameterTypeDescription
sstringThe text to print to the log file.

Returns

void


table()

table(data?): void

Displays tabular data as a table. Falls back to Console.log.

Parameters

ParameterType
data?unknown

Returns

void

See

https://developer.mozilla.org/docs/Web/API/console/table_static


time()

time(label): void

Starts a timer with the given label.

Parameters

ParameterTypeDefault value
labelstring'default'

Returns

void

See

https://developer.mozilla.org/docs/Web/API/console/time_static


timeEnd()

timeEnd(label): void

Logs the elapsed time for the given timer and removes it.

Parameters

ParameterTypeDefault value
labelstring'default'

Returns

void

See

https://developer.mozilla.org/docs/Web/API/console/timeEnd_static


timeLog()

timeLog(label, ...args): void

Logs the elapsed time for the given timer without removing it.

Parameters

ParameterTypeDefault value
labelstring'default'
...argsunknown[]undefined

Returns

void

See

https://developer.mozilla.org/docs/Web/API/console/timeLog_static


trace()

trace(...input): void

Logs the formatted input to the screen as white text, including a stack trace of where the function was invoked.

Parameters

ParameterType
...inputunknown[]

Returns

void


warn()

warn(...input): void

Logs the formatted input to the screen as yellow text.

Parameters

ParameterType
...inputunknown[]

Returns

void

On this page