JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 100911
  • Score
    100M100P100Q171383F
  • License MIT

Animated progress bars with estimated durations

Package Exports

  • progress-estimator

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (progress-estimator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

progress-estimator

Logs a progress bar and estimation for how long a Promise will take to complete. This library tracks previous durations in order to provide more accurate estimates over time.

Demo

Usage example

const {logProgress, configure} = require('progress-estimator');

// Configuration is optional, but it's recommended to specify a storage location.
// Learn more about configuration options below.
configure({
  storagePath: join(__dirname, '.progress-estimator'),
});

async function run() {
  await logProgress(promiseOne, "This promise has no initial estimate");
  await logProgress(
    promiseTwo,
    "This promise is initially estimated to take 1 second",
    1000
  );
}

Configuration

The following values are configurable via the named configure export. Note that all configuration is stored at the package level.

name type Description
spinner object Which spinner from the cli-spinners package to use. Defaults to dots.
storagePath string Where to record durations between runs. Defaults to os.tmpdir().
theme object Custom chalk theme. Look to the default theme for a list of required keys.