https://github.com/streetstrider/console-ultimate
Node-compatible `console` object with extra features
https://github.com/streetstrider/console-ultimate
console node
Last synced: about 1 year ago
JSON representation
Node-compatible `console` object with extra features
- Host: GitHub
- URL: https://github.com/streetstrider/console-ultimate
- Owner: StreetStrider
- License: other
- Created: 2015-03-15T15:35:48.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2025-03-23T18:28:13.000Z (about 1 year ago)
- Last Synced: 2025-04-14T15:21:31.451Z (about 1 year ago)
- Topics: console, node
- Language: JavaScript
- Homepage:
- Size: 1.22 MB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# What's this?
This is an opinionated console for Node with some default styling and additional features.
The main focus is to be Node-compatible console with more pretty look and feel.
There's also some additional features.
Turn it on with one line and get all the benefits at once.
# What's included?
* 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` and `console.time`.
* Deprecated methods are also supported for compability (`console.debug`, `console.dirxml`).
# Differences between v3 and v4
By the time of v3 the package was implemented with the help of transitional package called [esm](https://www.npmjs.com/package/esm). The package, in fact, CJS, but uses this package for sugars and as an experiment with early ESM syntax.
v4 is a direct upgrade to standard [ESM](https://nodejs.org/api/esm.html) with the same functionality and modern dependencies.
Both versions provide [export maps](https://nodejs.org/api/packages.html#package-entry-points).
# Install
```
npm i console-ultimate
```
# Turn on
```js
/* replace console instance globally */
import 'console-ultimate'
/* get instance with default options AND replace globally */
import console from 'console-ultimate'
/* get instance with default options (NOT replacing global instance) */
import console from 'console-ultimate/default'
/* upgrade global instance with certain options */
import upgrade from 'console-ultimate/upgrade'
/* upgrade */
upgrade({ stdout })
/*
instantiate your own custom instance
via `Console`, a Node-compatible constructor */
import Console from 'console-ultimate/Console'
let console = Console({ stdout })
console.log(console)
```
# Things to be done
* Better `thru` and `partial`.
* Retrieve (get formatted string instead of writing to stream).
* Advanced dir flags (like `hidden` & `noinspect`). (https://nodejs.org/api/util.html#util_util_inspect_object_options)
* Table props.
* `ignoreErrors`
* `debug`-like API with sub-instantiating, creating sybsystem-wise consoles.
* enable/disable instance.
* Proxy console.
* Browser-friendly.
* node-inspector integration.
# License
ISC, © 2025 Strider.