This package has been deprecated

Author message:

Unmaintained

happy-spinner

0.1.0 • Public • Published

Spinner for happy devs 😄

This spinner tries to get you happy while stuff is happening. For more awesome spinners check out ora.

Happy Spinner is happy!

Install

$ npm install --save happy-spinner

Usage

const text = 'Text be here'; // Optional
const interval = 100; // Optional
const happySpinner = require('happySpinner')(text, interval);
 
happySpinner.start();
 
setTimeout(() => {
    happySpinner.color = 'yellow';
    happySpinner.text = 'Loading rainbows';
}, 1000);
 
setTimeout(() => {
    happySpinner.succeed();
}, 3000);

API

text

Type: string Text to display after the spinner.

interval

Type: number
Default: Provided by the spinner or 100

Interval between each frame.

Spinners provide their own recommended interval, so you don't really need to specify this.

Instance

.start()

Start the spinner. Returns the instance.

.stop()

Stop and clear the spinner. Returns the instance.

.succeed()

Stop the spinner, change it to a green and persist the text. Returns the instance.

.fail()

Stop the spinner, change it to a red and persist the text. Returns the instance.

.clear()

Clear the spinner. Returns the instance.

.render()

Manually render a new frame. Returns the instance.

.frame()

Get a new frame.

.text

Change the text.

.color

Change the spinner color.

Contributing

All Contributions are welcome! Please open up an issue if you would like to help out. 😄

License

Created with ♥ by Tiaan du Plessis. Licensed under the MIT License.

Package Sidebar

Install

npm i happy-spinner

Weekly Downloads

2

Version

0.1.0

License

MIT

Last publish

Collaborators

  • tiaanduplessis