tty-aware-progress

[![Build Status](https://travis-ci.org/bkniffler/tty-aware-progress.png?branch=master)](https://travis-ci.org/bkniffler/tty-aware-progress)

MIT 5 个版本
安装
npm install tty-aware-progress
yarn add tty-aware-progress
pnpm add tty-aware-progress
bun add tty-aware-progress
README

tty-aware-progress

Build Status

The excellent progress package from npm will unfortunately ignore non-TTY environments like CI (circle-ci, travis, etc). This package uses progress, but in case of non-TTY, the progress will be output as rolling logs.

Install

npm install tty-aware-progress
# or
yarn add tty-aware-progress

Use

tty-aware-progress will only need the total number of expected ticks like shown below. It returns a function that emits progress.

import createProgress from 'tty-aware-progress';

const progress = createProgress(100);
for (var i = 0; i < 100; i++) {
  progress();
}

// OR

const progress = createProgress(100);
for (var i = 0; i < 10; i++) {
  progress(10);
}
版本列表
1.0.4 2018-12-12
1.0.3 2018-12-12
1.0.2 2018-12-12
1.0.1 2018-12-12
1.0.0 2018-12-12