Skip to content

Instantly share code, notes, and snippets.

@Tolsee
Last active August 9, 2018 06:12
Show Gist options
  • Save Tolsee/fc269d75f62d44bb5eff936f11a0bdb7 to your computer and use it in GitHub Desktop.
Save Tolsee/fc269d75f62d44bb5eff936f11a0bdb7 to your computer and use it in GitHub Desktop.
Cli spinner
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