A lightweight, customizable terminal spinner for Node.js applications.
- Simple and intuitive API
- Customizable animation frames
- Dynamic text updates
- Success and error states
- Manual control
- Unicode character support
import SimpleSpinner from "simplejack";
// Basic usage
const spinner = new SimpleSpinner("Processing...");
spinner.start();
// After some work
spinner.succeed("Complete!");
// Or on error
spinner.fail("Failed!");
const customFrames = ["🌑", "🌒", "🌓", "🌔", "🌕", "🌖", "🌗", "🌘"];
const spinner = new SimpleSpinner("Loading...", customFrames);
spinner.start();
const spinner = new SimpleSpinner("Starting up...");
spinner.start();
// Update text during operation
spinner.setText("Processing data...");
const spinner = new SimpleSpinner("Downloading...");
spinner.start();
// On error
spinner.fail("Download failed: Connection timeout");
new SimpleSpinner(
(text = "Loading..."), // Default text
(frames = [
// Default animation frames
"⠋",
"⠙",
"⠹",
"⠸",
"⠼",
"⠴",
"⠦",
"⠧",
"⠇",
"⠏",
])
);
start()
: Starts the spinnerstop(finalText)
: Stops the spinner with optional final textsucceed(text)
: Stops with success indicator (✅)fail(text)
: Stops with error indicator (❌)setText(text)
: Updates the spinner text
MIT