šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

cli-loading-animation

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cli-loading-animation

Small library that combine cli-spinners and log-update to display a loading animation in CLI apps made with Node.

1.0.6
latest
Source
npm
Version published
Maintainers
1
Created
Source

cli-loading-animation

This library combines cli-spinners and log-update to display a loading animation in CLI apps made with Node.

Install

# NPM
npm install cli-loading-animation

# Yarn
yarn add cli-loading-animation

Example

const { loading } = require('cli-loading-animation');

const { start, stop } = loading('Loading..');

start();

setTimeout(() => stop(), 3000);

Custom Spinner

const { loading } = require('cli-loading-animation');
const spinners = require('cli-spinners');

const { start, stop } = loading('Loading..', { clearOnEnd: false, spinner: spinners.bouncingBall });

start();

setTimeout(() => stop(), 3000);

Where spinner can be a object with frames (an array of strings) and interval (a number) property.

The library cli-spinners already provide several spinners in this format.

Options

OptionDescriptionDefault Value
spinnerCustom Spinner to usedots from the cli-spinners library
clearOnEndSpecifies if the loading line on the console must be cleared on calling the stop function.true

License

MIT

Keywords

loader

FAQs

Package last updated on 20 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts