@holz/ansi-terminal-backend
TypeScript icon, indicating that this package has built-in type declarations

0.6.0 • Public • Published

@holz/ansi-terminal-backend

Pretty-print logs to the terminal.

Screenshot of logs printed to the terminal

Usage

import { createAnsiTerminalBackend } from '@holz/ansi-terminal-backend';

const logger = createLogger(createAnsiTerminalBackend());

Note
There is no way to disable colors. The output relies on colors to convey structure. To disable colors, use a different backend such as @holz/stream-backend.

Options

createAnsiTerminalBackend({
  /**
   * By default it prints to the global console, but you can override it.
   * See: https://nodejs.org/api/console.html#new-consoleoptions
   */
  console: new Console(custom.stdout, custom.stderr),
});

Package Sidebar

Install

npm i @holz/ansi-terminal-backend

Weekly Downloads

15

Version

0.6.0

License

MIT

Unpacked Size

11.8 kB

Total Files

8

Last publish

Collaborators

  • psychollama