logf-spinner
TypeScript icon, indicating that this package has built-in type declarations

1.2.3 • Public • Published

LogF-Spinner · License: MIT build status Coverage Status

Simple terminal spinner. Usable standalone or with other log-frame components.

Install

npm install logf-spinner

Usage

const { LogFrame } = require('log-frame');
const { Spinner } = require('logf-spinner');
 
// create, configure, and start spinner
const spinner = new Spinner('dots');
spinner.text = 'loading';
spinner.color = 'cyan';
spinner.start();
 
// attach to frame for display
const frame = new LogFrame();
frame.view = spinner;

API

new Spinner('theme')

theme

The name of a spinner theme from cli-spinners. Some examples:

Or a custom theme object:

new Spinner({
  frames: ['-', '|'],
  interval: 40, // optional, default is 20
});

Methods

.start()

Start spinning.

.stop()

Stop spinning.

Properties

.text (string)

Optional text to display next to the spinner.

.color (string)

Optional color tint to apply to the spinner.

Package Sidebar

Install

npm i logf-spinner

Weekly Downloads

3

Version

1.2.3

License

MIT

Unpacked Size

13.3 kB

Total Files

15

Last publish

Collaborators

  • tylerwbell