create-spinner

v0.1.0
Create an elegant spinner with ease

create-spinner

Create an elegant spinner with ease

Install

npm install --save create-spinner

Usage

const createSpinner = require('create-spinner');

const stopSpinner = createSpinner(`Some text`);
return new Promise(function(resolve, reject)  {
    if (err) {
        stopSpinner(false);
        reject(err);
    } else {
        stopSpinner(true);
        resolve();
    }
});

API

createSpinner(text, first)

Create a spinner and return a function that must be called when you want to stop the spinner. The function takes a boolean as argument to tell if the operation was successful or not.

text

Type: string

Text to display

first (optional)

Type: boolean

If true, don't go to the next line (only useful when you create multiple spinners)

License

MIT © Olivier Ligot

npm i create-spinner

Metadata

  • MIT
  • Whatever
  • Olivier Ligot
  • released 4/29/2016

Downloads

Maintainers