Releases: StreetStrider/console-ultimate
Releases · StreetStrider/console-ultimate
4.1.0
4.0.0
ESM release.
3.0.0
- Fully Node-compatible API. So console-ultimate can replace
console
globally. - Nicely looking
log
,info
,warn
,error
. They are colored, so more distinctive in terminal.
Also some unicode decorations included. - Better stack traces and overall
error
formatting. Stack trace is cleared from internal entries (console.error
,console.trace
). - Nice grouping (
console.group
) with visual indentation and pseudographics. console.table
with adequate table width, including ansi-colored things, nice borders and colors.- FP-friendly loggers that can passthrough value, so they can be used in pipes (
.then
,.map
etc…). - All other stuff, like
console.count
andconsole.time
. - Deprecated methods are also supported for compability (
console.debug
,console.dirxml
).
v2.0.0
Some breaking changes was made:
console.time
uses hi-res time by default. can be turned off infeatures
.console.dir
now supports output to custom stream (likelog
,warn
, and others do). Options was changed.- colors now respect
tty
. console.trace
upgraded with better stack traces.
v1.0.0: pre-release 3
Per-feature gates are moved to options.features
. All features are enabled by default. All features can be disabled by assigning false
to options.features
:
var console = Console(null, null, {
features: false
});
Additional features will be switched off, basic Node features (like timers, but not log & dir) will be noop-ed.
Certain features can be disabled:
var console = Console(null, null, {
features:
{
count: false
}
});
v1.0.0: pre-release 1
Everything Node-specific is implemented (at least, on basic level).
console.trace
,console.assert
, and examples.styling.prefix
to enable/disable prefixes for all functions, enabled by default.
v0.3.0: timers
This release mainly introduces timers.
console.time
&console.timeEnd
as in Node.- Timer feature can be turned off, but for compability reasons it's not removed from object, but replaced with noop-functions.
console.time.retrieve
works liketimeEnd
but does not output result, instead returns it, allowing to use it later.console.time.end
as semantical alias forconsole.timeEnd
.- It is possible to turn on hi-res timer (uses
process.hrtime
):
var console = Console(null, null,
{
timer:
{
hrtime: true
}
});
- This module implementation of
timeEnd
deletes used timer ref, but Node's does not (7cff79f). If anyone will need «broken» Node's implementation (which allow totimeEnd
one timer multiple times), open issue.
What's else:
v0.2.0
A bunch of improvements to move console to «ultimate» state a little closer.
What's:
console.colors
is an instance of cli-color now.console
's.log
,.info
,.warn
,.error
are customizable:- prefixes
- colors
- output streams: stdout or stderr
var console = Console(null, null, {
styling: {
log: {
prefix: ' * ',
color: console.colors.green,
stream: 'stdout' // can be 'stderr' or 'stdout'
}
}
});
console.clear
: clears output streams.console.count
: counts own calls.console.debug
: simple alias of.log
.- feature gates for
.debug
,.count
,.clear
:
var console = Console(null, null, {
styling: true,
count: true,
clear: true
// debug: false
});
v0.1.0
First release with Console
object concept.
What's:
console
's.log
,.info
,.warn
,.error
all compatible with Node' ones. Colors is used for.info
,.warn
,.error
. In next releases coloring will be controlled by option flags.console.dir
compatible with Node's one. It's also supports extra flags, like:
console.dir(object, 5);
// where number 5 is `depth` → { depth: 5 }
console.dir(object, 'showHidden', 1, 'colors');
// for turning hidden attributes display, with depth = 1 and colors enabled
// → { showHidden: true, depth: 1, colors: true }
Console
constructor works like Node's one, by passing streams, streams are optional and defaults to process[ stdout, stderr ]
pair.Console
is UC, i.e. universal constructor and can be invoked as simple function, withoutnew
keyword.