npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

hbh-cli.s

v0.0.2

Published

A lightweight cli spinner, 70+ spinners

Readme

🌀 hbh-cli.s

A lightweight CLI spinner library for Node.js featuring 70+ spinners and customizable animations. Perfect for adding visual feedback in command-line tools or scripts.


Table of Contents


Installation

Install via npm:

npm install hbh-cli.s

Or using yarn:

yarn add hbh-cli.s

Features

  • 70+ prebuilt spinners: Arrows, Bars, Waves, Rockets, Hearts, Emoji animations, and more.
  • Flexible CLI usage: Interactive spinner selection or programmatic control.
  • Customizable: Control interval, duration, and frame events (render, stop, play, pause).
  • Looping & smooth animations: With generator-based frame loops.
  • Lightweight: No heavy dependencies, minimal footprint.

Usage

Basic Usage

import { renderSpinnerCLI } from 'hbh-cli.s';

const spinner = renderSpinnerCLI({
  name: 'Rocket', 
  interval: 100,
  events: {
    render: frame => process.stdout.write(`\r${frame} Launching...`),
    stop: () => console.log('\n🚀 Done!'),
  }
});

setTimeout(() => spinner.stop(), 5000); // Stop after 5 seconds

Run a Single Spinner

import { runOne } from 'hbh-cli.s';

await runOne({
  name: 'Rocket',
  interval: 80,
  timeout: 5000,
  events: {
    render: f => process.stdout.write(`\r${f} launching...`),
    stop: () => console.log('\n🚀 Liftoff complete!'),
  }
});
  • timeout determines how long the spinner runs (ms).
  • events allows custom handlers for render, stop, etc.

Run All Spinners Sequentially

import { runAllSpinnersCLI } from 'hbh-cli.s';

await runAllSpinnersCLI(100, 3000); 
  • Runs all available spinners one by one in the terminal.
  • interval sets frame update speed.
  • duration sets how long each spinner runs.

CLI Interactive Mode

import { CLI } from 'hbh-cli.s';

// Starts an interactive spinner menu
CLI.start;
  • Lists all available spinners.

  • Choose a spinner by number or name.

  • Controls:

    • [p] to pause/resume
    • [q] to quit

API

renderSpinnerCLI(conf)

Renders a spinner in CLI.

Parameters:

interface SpinnerConfig {
  name?: string;           // Spinner name (default: 'Dots')
  interval?: number;       // Frame interval in ms (default: 100)
  events?: {               // Event callbacks
    render?: (frame) => void,
    stop?: () => void,
    play?: () => void,
    pause?: () => void
  }
}

Returns: SpinnerController instance.


startSpinnerByName(name, options)

Start a spinner programmatically by name.

const spinner = startSpinnerByName('Rocket', { interval: 80 });
spinner.play();

runOne(conf)

Runs a single spinner asynchronously. See Run a Single Spinner.


runAllSpinnersCLI(interval, duration)

Runs all spinners sequentially in the CLI. See Run All Spinners.


SpinnerController

Controls a spinner instance programmatically.

const spinner = renderSpinnerCLI({ name: 'Dots' });

spinner.pause();
spinner.play();
spinner.stop();
spinner.restart();
spinner.isPlaying(); // true/false

Custom Spinners

You can use your own frame arrays:

import { SpinnerController } from 'hbh-cli.s';

const frames = ['😀','😃','😄','😁'];
const spinner = SpinnerController({
  generatorFn: function* () {
    let i = 0;
    while (true) yield frames[i++ % frames.length];
  },
  interval: 200,
  events: {
    render: f => process.stdout.write(`\r${f} `)
  }
});

spinner.play();

Or use SpinnerGenerator.js:

import { Generator } from 'hbh-cli.s';

const rocketFrames = Generator.Rocket({ rocket: '🚀', length: 6 });
console.log(rocketFrames);

License

ISC License