Releases: StreetStrider/console-ultimate
Releases · StreetStrider/console-ultimate
4.1.1
4.1.0
TS release.
4.0.0
ESM release.
3.0.0
- Fully Node-compatible API. So console-ultimate can replace
consoleglobally. - Nicely looking
log,info,warn,error. They are colored, so more distinctive in terminal.
Also some unicode decorations included. - Better stack traces and overall
errorformatting. Stack trace is cleared from internal entries (console.error,console.trace). - Nice grouping (
console.group) with visual indentation and pseudographics. console.tablewith 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,.mapetc…). - All other stuff, like
console.countandconsole.time. - Deprecated methods are also supported for compability (
console.debug,console.dirxml).
v2.0.0
Some breaking changes was made:
console.timeuses hi-res time by default. can be turned off infeatures.console.dirnow supports output to custom stream (likelog,warn, and others do). Options was changed.- colors now respect
tty. console.traceupgraded 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.prefixto enable/disable prefixes for all functions, enabled by default.
v0.3.0: timers
This release mainly introduces timers.
console.time&console.timeEndas 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.retrieveworks liketimeEndbut does not output result, instead returns it, allowing to use it later.console.time.endas 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
timeEnddeletes used timer ref, but Node's does not (7cff79f). If anyone will need «broken» Node's implementation (which allow totimeEndone 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.colorsis an instance of cli-color now.console's.log,.info,.warn,.errorare 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,.errorall compatible with Node' ones. Colors is used for.info,.warn,.error. In next releases coloring will be controlled by option flags.console.dircompatible 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 }Consoleconstructor works like Node's one, by passing streams, streams are optional and defaults to process[ stdout, stderr ]pair.Consoleis UC, i.e. universal constructor and can be invoked as simple function, withoutnewkeyword.