Awesome deno terminal spinners 🎨
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples docs: update README.md Feb 3, 2019
.prettierrc chore: initial commit Feb 3, 2019
LICENSE docs: add license Feb 3, 2019
README.md docs: fix typo in README.md Feb 4, 2019
mod.ts chore: initial commit Feb 3, 2019
spinner.ts docs: update README.md Feb 3, 2019
spinners.ts chore: initial commit Feb 3, 2019
util.ts chore: initial commit Feb 3, 2019

README.md

CLI Spinners for Deno

Awesome deno terminal spinners

example screenshot

Usage

import Spinner from 'https://raw.githubusercontent.com/ameerthehacker/cli-spinners/master/mod.ts';

const spinner = Spinner.getInstance();

spinner.start('running step 1');
// Perform long running step 1
spinner.setText('running step 2');
// Perform long running step 2
spinner.stop();

API

Spinner.getInstance();

This will return a singleton instance for the Spinner class.

await spinner.start(text: string);

This will start a spinner with the given text.

await spinner.stop();

This will stop the spinner and clears the line.

spinner.setText(text: string);

Updates the text shown with the spinner.

spinner.setSpinnerType(type: string);
  • This is used to update the spinner type
  • The detault spinner type is dots2
  • To see list of all available spinner types please refer here
await spinner.succeed([text]: string);

Stop the spinner, change it to a green and persist the current text, or text if provided.

await spinner.fail([text]: string);

Stop the spinner, change it to a red and persist the current text, or text if provided.

await spinner.warn([text]: string)

Stop the spinner, change it to a yellow and persist the current text, or text if provided.

await spinner.info([text]: string)

Stop the spinner, change it to a blue and persist the current text, or text if provided.

await spinner.isRunning();

Returns true if the spinner is running.

License

MIT © Ameer Jhan