A tiny, dependency-free CLI spinner for Node.js — perfect for showing progress during async tasks, installs, or API calls.
npm install cli-spinner-litexUse cli-spinner-litex to display a simple, animated spinner during any asynchronous process.
import Spinner from "cli-spinner-litex";
const spin = new Spinner("Fetching data...");
spin.start();
setTimeout(() => {
spin.updateText("Still working...");
}, 2000);
setTimeout(() => {
spin.stop("Completed successfully!");
}, 4000);When you run this script in your terminal, the spinner will animate as your code runs:
○ Fetching data...
○ Still working...
✔ Completed successfully!
That’s it — no dependencies, just a clean visual indicator for your CLI tasks.
Creates a new spinner instance.
| Parameter | Type | Description |
|---|---|---|
text |
string |
Message text shown beside the spinner |
frames |
string[] |
Custom animation frames (optional) |
Starts the spinner. Optionally updates the message.
Updates the displayed message while spinning.
Stops the spinner and prints a success checkmark (✔).
Stops the spinner and prints a failure cross (✖).
Switches the spinner style dynamically.
cli-spinner-litex includes a few built-in animation frame sets you can use:
import Spinner, { spinners } from "cli-spinner-litex";
const spin = new Spinner("Processing...", spinners.line);
spin.start();
setTimeout(() => spin.stop("Done!"), 2000);Available presets:
export const spinners = {
dots: ["⠋", "⠙", "⠸", "⠴", "⠦", "⠇"],
line: ["-", "\\", "|", "/"],
pulse: ["·", "●", "·", "○"],
};✅ Zero dependencies
✅ Works on macOS, Linux, and Windows
✅ Small (~55 lines of code)
✅ Customizable spinner frames
✅ Perfect for any CLI script or Node.js tool
#!/usr/bin/env node
import Spinner from "cli-spinner-litex";
const spinner = new Spinner("Running heavy task...");
spinner.start();
setTimeout(() => {
spinner.stop("Task completed!");
}, 3000);Output:
○ Running heavy task...
✔ Task completed!
MIT © 2025 Mohammed (DevMasud)
Give it a ⭐ on GitHub!
Follow me on X (Twitter) for updates and dev tips! 🚀