create-spinner
Create an elegant spinner with ease
Last updated 4 years ago by oligot .
MIT · Original npm · Tarball · package.json
$ cnpm install create-spinner 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.1.0                                ...           latest (4 years ago)

1 Versions

  • 0.1.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (3)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |