@open-tech-world/node-cli-progress
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

@open-tech-world/node-cli-progress

Build CodeFactor npm (scoped)

CLI spinner with task progress result.

Installation

Using npm

npm install @open-tech-world/node-cli-progress

Using Yarn

yarn add @open-tech-world/node-cli-progress

Usage

import { cliProgress } from '@open-tech-world/node-cli-progress';

const progress = new cliProgress();
progress.start();
setTimeout(() => {
  progress.update('Downloading');
}, 1000);
progress.done('Download completed!');

API

new cliProgress(options?: Partial<IOptions>)

It creates a new instance of the cliProgress.

options:

Name Type Default Description
stream NodeJS.WriteStream process.stderr The stream to use.

Instance methods:

start(text?: string)

This method starts the spinner with optional text.

The default text is Loading.

update(text: string)

This method updates the current text with the given text.

done(text?: string)

This method stops the spinner and mark the task as success with optional text.

fail(text?: string)

This method stops the spinner and mark the task as failed with optional text.

warn(text?: string)

This method stops the spinner and mark the task as warning with optional text.

info(text?: string)

This method stops the spinner and mark the task as info with optional text.

License

Copyright (c) 2021, Thanga Ganapathy (MIT License).

Dependencies (1)

Dev Dependencies (14)

Package Sidebar

Install

npm i @open-tech-world/node-cli-progress

Weekly Downloads

0

Version

0.2.1

License

MIT

Unpacked Size

11.8 kB

Total Files

8

Last publish

Collaborators

  • ganapathy