Files
pnpm/cli/default-reporter
Felix Wolfsteller 8a4dac63c3 feat(cli-output): harmonize download progress out (#6902)
When running the CLI, downloads will show their progress,
e.g. `1.12 MB/ 3 MB`, showing only significant digits.

As the output is constantly updated, the length of the line in the
output might constantly change (2.99 -> 3 -> 3.3 -> 3.33), leading
to a visually very noisy display.

close #6901

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2023-08-04 04:08:28 +03:00
..
2023-07-26 17:50:12 +03:00
2023-07-26 17:50:12 +03:00

@pnpm/default-reporter

The default reporter of pnpm

Installation

pnpm add @pnpm/default-reporter

Usage

import { streamParser } from '@pnpm/logger'
import { initDefaultReporter } from '@pnpm/default-reporter'

const stopReporting = initDefaultReporter({
  context: {
    argv: [],
  },
  streamParser,
})

try {
  // calling some pnpm APIs
} finally {
  stopReporting()
}

Style Guide

  1. Never use blue or grey as font color as they are hard to read in many consoles.
    1. Use dim instead of grey
    2. Use cyan bright instead of blue
  2. Don't hide the CLI cursor. (It is easier to never hide but it is really needed only when scripts are running.)
  3. Don't use green and yellow to distinct something.

License

MIT