Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including char-spinner with all npm packages installed. Try it out:

var charSpinner = require("char-spinner")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

char-spinner v1.0.1

Put a little spinner on process.stderr, as unobtrusively as possible.


Put a little spinner on process.stderr, as unobtrusively as possible.


var spinner = require("char-spinner")

// All options are optional
// even the options argument itself is optional


Usually the defaults are what you want. Mostly they're just configurable for testing purposes.

  • stream Output stream. Default=process.stderr
  • tty Only show spinner if output stream has a truish .isTTY. Default=true
  • string String of chars to spin. Default='/-\\|'
  • interval Number of ms between frames, bigger = slower. Default=50
  • cleanup Print '\r \r' to stream on process exit. Default=true
  • unref Unreference the spinner interval so that the process can exit normally. Default=true
  • delay Number of frames to "skip over" before printing the spinner. Useful if you want to avoid showing the spinner for very fast actions. Default=2

Returns the generated interval, if one was created.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free