Put a little spinner on process.stderr, as unobtrusively as possible.
import { spinner } from 'char-spinner'
// All options are optional
// even the options argument itself is optional
const clear = spinner(options)
// the return value is the clear function
// call it to stop the spinner
clear()Usually the defaults are what you want. Mostly they're just configurable for testing purposes.
streamOutput stream. Default=process.stderrttyOnly show spinner if output stream has a truish.isTTY. Default=truestringString of chars to spin. Default='/-\\|'intervalNumber of ms between frames, bigger = slower. Default=50cleanupPrint'\r \r'to stream on process exit. Default=trueunrefUnreference the spinner interval so that the process can exit normally. Default=truedelayNumber of frames to "skip over" before printing the spinner. Useful if you want to avoid showing the spinner for very fast actions. Default=2promisePass in a promise or promise-returning function if you want it to automatically stop spinning when the promise resolves.
Returns a clear function if a spinner was created, otherwise
undefined.