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 🙏

© 2026 – Pkg Stats / Ryan Hefner

nspin-esm

v1.2.0

Published

Lightweight and efficient ESM spinner package for modern Node.js runtimes

Readme

nspin-esm

NPM Version NPM Downloads

Overview

nspin-esm is a lightweight, efficient Node.js spinner package built entirely with native features for optimal performance. As an ESM-only package designed for modern Node.js (v22+), it provides a simple, intuitive, and dependency-free API to create and manage spinner animations in your applications.

nspin-esm

Requirements

  • Node.js 22+: Access modern APIs such as styleText and performance.now().
  • Exclusively ESM: Enjoy modern module resolution and a cleaner development experience.

Key Features

  • Lightweight & Efficient: Leverages native Node.js features to minimize overhead.
  • ESM-Only: Optimized for modern ECMAScript module usage.
  • Zero Dependencies: No external libraries—ensuring fast, secure, and minimal installations.
  • Chainable API: Methods like start, updateText, updateFrames, and stop return the spinner instance for fluent usage.
  • Dynamic Frame Updates: Change spinner animation frames on the fly.
  • Adaptive Output: Automatically adjusts for both TTY and non-TTY environments.
  • Position Configuration: Option to position the spinner to the left (default) or right of the text.
  • Robust Error Handling: Designed to degrade gracefully in non-TTY environments and handle runtime nuances.

Installation

Install nspin-esm via npm:

npm install nspin-esm

Quick Usage

Below is a basic example demonstrating how to initialize a spinner, update its message dynamically, and stop it after a task is complete.

import { Spinner } from "nspin-esm";

// Define spinner frames (simple rotation)
const simpleRotation = ["|", "/", "-", "\\"];

// Start the spinner with an initial message
const spinner = new Spinner({
  frames: simpleRotation,
  interval: 100
}).start("Loading...");

// Stop the spinner after 3 seconds with a final message
setTimeout(() => {
  spinner.stop("Done!");
}, 3000);

API Overview

  • new Spinner(options) Create a new spinner instance with options:

    • frames: Array of spinner frames (e.g., ["|", "/", "-", "\\"]).
    • interval: Delay between frames in milliseconds (default: 80).
    • format: Styling options via styleText.
    • position: Placement relative to text ('left' or 'right').
  • Instance Methods:

    • start(text?: string): Begins the spinner with an optional message.
    • updateText(newText: string): Updates the spinner’s displayed message.
    • updateFrames(newFrames: string[]): Dynamically changes the spinner frames.
    • stop(finalText?: string): Stops the spinner and shows a final message.

Additional Information

  • Performance & Modernity: Built exclusively as an ESM package, nspin-esm takes full advantage of Node.js v22+ features to ensure a high-performance, modern development experience.

  • Error Handling & Compatibility: The package is designed to gracefully handle non-TTY environments, ensuring that output remains clear and useful even when advanced terminal features are unavailable.

  • Clean & Modular Design: Following SOLID principles, the library is modular and easy to extend, making it an excellent choice for projects that need maintainable and scalable code.

Documentation & Support

For detailed documentation—including comprehensive usage examples, advanced API reference, and contribution guidelines—please visit the GitHub repository.

If you encounter any issues or have suggestions, please open an issue on GitHub.


This README for npm is a simplified version. For the complete documentation and all available examples, please refer to the full README on GitHub.