Socket
Book a DemoInstallSign in
Socket

char-spinner

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

char-spinner

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

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
236K
37.07%
Maintainers
1
Weekly downloads
 
Created
Source

char-spinner

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

USAGE

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()

OPTIONS

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
  • promise Pass in a promise or promise-returning function if you want it to automatically stop spinning when the promise resolves.

Returns the generated interval, if one was created.

Keywords

char

FAQs

Package last updated on 07 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts