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

@backendkit-labs/console-animations

v0.1.3

Published

Enterprise-grade terminal animations library for Node.js CLI applications

Readme

@backendkit-labs/console-animations

npm version CI License Node Downloads

Enterprise-grade terminal animations for Node.js CLI applications and backend processes.

17 built-in animations — spinners, progress bars, loaders and visual effects — with terminal states (succeed / fail / warn), dynamic text updates, CI detection, and zero runtime dependencies.

# Try it instantly
npx @backendkit-labs/console-animations

Animations Preview

Spinners & Loaders

| Animation | Type | Frames | Use case | |-----------|------|--------|----------| | Spinner | SPINNER | | Tasks, installs, fetching | | Dots | DOTS | | Waiting, processing | | Pulse | PULSE | · | Heartbeat, status check | | Worm | WORM | [●─────────] [────●─────] [─────────●] | Indeterminate progress | | Snake | SNAKE | ●········· ·····●···· ·········● | Scanning, searching | | Bouncing Ball | BOUNCING_BALL | [◉ ] [ ◉ ] [ ◉] | Loading, buffering |

Progress & Fill

| Animation | Type | Frames | Use case | |-----------|------|--------|----------| | Progress Bar | PROGRESS_BAR | [████████░░░░] 67% \| ETA: 4s | File download, build steps | | Cyberpunk | CYBERPUNK | ▰▱▱▱▱▱▱▱▱▱ ▰▰▰▰▰▱▱▱▱▱ ▰▰▰▰▰▰▰▰▰▰ | Deploy, upload, sync |

Text & Typing

| Animation | Type | Frames | Use case | |-----------|------|--------|----------| | Typing | TYPING | D█ De█ Dep█ Deploy█ | Command output, logs |

Visual Effects

| Animation | Type | Frames | Use case | |-----------|------|--------|----------| | Waves | WAVES | ▁▂▃▄▅▆▇█▇▆▅▄▃▂ ▂▃▄▅▆▇█▇▆▅▄▃▂▁ | Audio, processing | | Matrix | MATRIX | ヲアカコサシスセソ イウエオタチツテト | Data stream, encryption | | Hacker | HACKER | [FF] A3 2B 7C [A3] 7C FF 2B | Hex scan, network | | Rain | RAIN | ╷│╵ pattern | Ambient, idle state | | Fire | FIRE | ▲▲▲ ▲▲▲█▲▲▲ | Alerts, hot paths | | Stars | STARS | ✦ ✧ ✦ ✧ ✧ ✦ ✧ ✦ | Success, decorative | | Particles | PARTICLES | · · · · · · ··· | Ambient | | Futurista | FUTURISTA | ◆ ◇ ◆ ◇ ◆ ◇ ◈ ◇ ◈ | Sci-fi, startup |


Installation

npm install @backendkit-labs/console-animations

Quick Start

import { AnimationManager, AnimationType } from '@backendkit-labs/console-animations';

const manager = new AnimationManager();

const spinner = manager.start({
  type: AnimationType.SPINNER,
  color: 'cyan',
  prefix: '  Installing packages ',
});

setTimeout(() => {
  manager.succeed(spinner.id, 'Packages installed');
}, 3000);

Terminal States

Stop animations with a visible result — the most important feature for professional CLIs:

manager.succeed(id, 'Build complete')   // ✔ Build complete   (green)
manager.fail(id, 'Build failed')        // ✖ Build failed     (red)
manager.warn(id, 'Skipped 3 files')     // ⚠ Skipped 3 files  (yellow)
manager.info(id, 'Cache hit')           // ℹ Cache hit        (cyan)

Works in CI too — animations are silent in non-TTY environments, only the final state is printed.


Presets

Ready-to-use configurations for the most common backend and CLI scenarios:

import { AnimationManager, Presets } from '@backendkit-labs/console-animations';

const manager = new AnimationManager();

// One-liner for common tasks
const s = manager.start(Presets.install('Installing dependencies'));
const b = manager.start(Presets.build('Compiling TypeScript'));
const d = manager.start(Presets.deploy('Deploying to production'));
const c = manager.start(Presets.connect('Connecting to database'));

// With auto succeed/fail via run()
const result = await manager.run(
  Presets.build('Building'),
  () => runWebpack(),
);

| Preset | Animation | Color | Use case | |--------|-----------|-------|----------| | Presets.install(text?) | SPINNER | cyan | npm/package installs | | Presets.build(text?) | DOTS | yellow | Compilation, bundling | | Presets.deploy(text?) | WORM | magenta | Deployments | | Presets.connect(text?) | PULSE | blue | DB / network connections | | Presets.migrate(text?) | SNAKE | yellow | DB migrations | | Presets.download(text?, total?) | PROGRESS_BAR | cyan | Downloads with ETA | | Presets.upload(text?, total?) | CYBERPUNK | green | Uploads | | Presets.encrypt(text?) | HACKER | greenBright | Encryption / hashing | | Presets.scan(text?) | MATRIX | green | Security scans | | Presets.stream(text?) | WAVES | cyan | Data streaming |


Progress Bar with ETA

const bar = manager.start(Presets.download('Downloading package', 100));

// Drive progress externally — ETA is calculated automatically
bar.setProgress(30);  // [████████░░░░░░░░░░░░░░░░░░░░░░]  30% | ETA: 7s
bar.setProgress(60);  // [████████████████░░░░░░░░░░░░░░]  60% | ETA: 3s
bar.setProgress(100); // [██████████████████████████████] 100% | 1.2s

manager.succeed(bar.id, 'Download complete');

Dynamic Updates

Change text or config while an animation is running:

const s = manager.start(Presets.install('Resolving packages'));

// Update prefix mid-flight
manager.update(s.id, { prefix: '  Downloading packages ' });
manager.update(s.id, { prefix: '  Linking dependencies ' });

manager.succeed(s.id, 'Installation complete');

Async Workflow with Auto-stop

// run() automatically calls succeed() on resolve, fail() on reject
const result = await manager.run(
  Presets.deploy('Deploying to production'),
  () => deployToProduction(),
  {
    successText: 'Deployed successfully',
    failText: 'Deployment failed',
  },
);

CI / Non-TTY Detection

Animations are automatically disabled in non-interactive environments (CI, piped output). Only terminal states are printed:

# In a terminal (interactive)
⠙ Building TypeScript...   ← animated

# In GitHub Actions / CI
✔ Building TypeScript       ← only final state, no animation noise

No configuration needed — detection is automatic via process.stdout.isTTY and process.env.CI.


API Reference

AnimationManager

| Method | Signature | Description | |--------|-----------|-------------| | start | (config) → IAnimation | Creates and starts an animation | | stop | (id) → void | Stops silently | | succeed | (id, text?) → void | Stops with ✔ (green) | | fail | (id, text?) → void | Stops with ✖ (red) | | warn | (id, text?) → void | Stops with ⚠ (yellow) | | info | (id, text?) → void | Stops with ℹ (cyan) | | update | (id, partial) → void | Updates config while running | | pause | (id) → void | Freezes current frame | | resume | (id) → void | Resumes a paused animation | | destroy | (id) → void | Stops and releases resources | | destroyAll | () → void | Destroys all active animations | | get | (id) → IAnimation \| undefined | Gets animation by ID | | getAll | () → IAnimation[] | Returns all active animations | | getByType | (type) → IAnimation[] | Filters by type | | run<T> | (config, task, opts?) → Promise<T> | Wraps async task with auto-stop |

AnimationBuilder

Fluent API for composing configs:

import { AnimationBuilder, AnimationType } from '@backendkit-labs/console-animations';

const config = new AnimationBuilder()
  .setType(AnimationType.WORM)
  .setColor('magenta')
  .setSpeed(60)
  .setPrefix('  Migrating database ')
  .build();

const anim = manager.start(config);

AnimationConfig

| Property | Type | Default | Description | |----------|------|---------|-------------| | type | AnimationType | required | Animation type | | id | string | auto | Unique animation ID | | text | string | '' | Text for typing animation | | color | Color | undefined | ANSI color | | speed | number | 80 | ms between frames | | prefix | string | '' | Text before the animation | | suffix | string | '' | Text after the animation | | overwrite | boolean | true | Overwrite current line | | multiline | boolean | false | Multi-line frame | | frames | string[] | undefined | Custom frame array | | width | number | 20 | Progress bar width | | total | number | 100 | Progress bar total steps | | showEta | boolean | false | Show ETA on progress bar | | custom | Record<string, unknown> | undefined | Extra data for custom animations |

Colors

black red green yellow blue magenta cyan white gray grey redBright greenBright yellowBright blueBright magentaBright cyanBright whiteBright

Events

manager.on(AnimationEvent.START,        (data) => { /* animation started */ });
manager.on(AnimationEvent.STOP,         (data) => { /* animation stopped */ });
manager.on(AnimationEvent.STATE_CHANGE, (data) => { /* state transition  */ });
manager.on(AnimationEvent.FRAME,        (data) => { /* new frame rendered */ });
manager.on(AnimationEvent.ERROR,        (data) => { /* error occurred     */ });

Custom Animations

import { AbstractAnimation, AnimationConfig } from '@backendkit-labs/console-animations';

class MyAnimation extends AbstractAnimation {
  constructor(config: AnimationConfig) {
    super(config);
  }

  protected buildFrames(): string[] {
    return ['◐', '◓', '◑', '◒'];
  }
}

Architecture

AnimationManager (Facade)
  ├── AnimationFactory    — creates animations by type
  ├── AnimationRegistry   — ID → IAnimation map
  ├── FrameScheduler      — adaptive loop, min 16 ms
  ├── RenderEngine        — stdout writer + ANSI + CI detection
  └── EventEmitter        — observer pattern

AbstractAnimation (Template Method)
  └── 17 concrete animations

AnimationBuilder   — fluent config builder
Presets            — ready-to-use configs for common tasks
terminal / symbols — environment detection utilities

Running Examples

git clone https://github.com/backendkit-dev/backendkit-monorepo.git
cd backendkit-monorepo/packages/console-animations
npm install && npm run build

npx tsx examples/basic-usage.ts
npx tsx examples/multi-animation.ts
npx tsx examples/custom-animation.ts
npx tsx examples/async-workflow.ts

License

Apache-2.0 — BackendKit Labs