Last active
August 9, 2018 06:12
-
-
Save Tolsee/fc269d75f62d44bb5eff936f11a0bdb7 to your computer and use it in GitHub Desktop.
Cli spinner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Spinner = require('cli-spinner').Spinner; | |
// Create a spinner | |
const spinner = new Spinner('Syncing data.. %s'); | |
// Set a string, that shows loding and replaced with %s in above declaration | |
spinner.setSpinnerString('▖▘▝▗'); | |
// Now you can start spinner when ever you want | |
// For our case before http request | |
spinner.start(); | |
// Now you can stop spinner when ever you want | |
// For our case after http request | |
spinner.stop(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment