Skip to content

mahankals/cli-steps

Repository files navigation

App Title

The list of spinners is just a JSON file and can be used wherever.

Install

npm install https://github.com/mahankals/cli-steps.git

Usage

const cliProcess = require('cli-steps');
const process = new cliProcess({
  style: 'binary',
  success: 'Finish',
  fail: 'Fail',
});

process.start();
process.text = "Downloading 0%";

let progressPercent = 0;

const updateProgress = () => {
  if (progressPercent <= 100) {
    process.text = `Downloading ${progressPercent}%`;

    setTimeout(() => {
      progressPercent += 10; // Update progress by 10%
      updateProgress();
    }, 1000);
  } else {
    process.succeed("Download completed.");
  }
};

updateProgress();

About

Steps/Progress updated for use in the terminal

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published