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

frogress-bar

v0.1.0

Published

React based progress bar for command-line/terminal applications

Readme

frogress-bar

React based progress bar for command-line/terminal applications

Features

  • 🌱 Simple & Easy to use
  • 🔥 Supports single & multiple progress bar
  • 🎨 Supports 256 & Truecolor
  • 💧 Responsive size
  • ⭐️ Fully customizable

Installation

# npm
npm install frogress-bar

# yarn
yarn add frogress-bar

Usage

import * as Frogress from 'frogress-bar';

// 1. Create new progress bar
const progressBar = Frogress.create({
  total: 100,
  template: '{label} {progress} ({percentage})',
  placeholder: {
    label: 'Downloader',
  },
});

// 2. Render progress bar
progressBar.start({ value: 0 });

await download({
  onProgress: (percent) => {
    // 3. Update progress bar state
    progressBar.update({ value: percent });
  },
});

// 4. Unmount progress bar#
progressBar.stop();

// 5. Remove progress bar
Frogress.remove(progressBar);
Frogress.removeAll();

single-progress-bar

Demo

multiple-progress-bars

Demo

multiple-progress-bars

Demo

multiple-progress-bars

Documentation

create

Create a new ProgressBar instance. It can be called multiple times for multiple progress bars.

  • Parameters | Name | Type | Required | |:--|:--|:--| | options | ProgressConfig | No |
  • Return Value | Type | |:--| | ProgressBar |
/* interfaces */

interface ProgressConfig {
  /**
   * Defaults to `0`.
   */
  value?: number;
  /**
   * Defaults to `100`.
   */
  total?: number;
  /**
   * Defaults to `50` (Depend on terminal size).
   */
  progressBarSize?: number;
  /**
   * Defaults to `'█'`.
   */
  activeChar?: string;
  /**
   * Defaults to `'░'`.
   */
  inactiveChar?: string;
  /**
   * Template string.
   *
   * Defaults to `'{progress}'`.
   */
  template?: string;
  /**
   * Key-Value data that replace of template's placeholders.
   *
   * Defaults to `{}`.
   */
  placeholder?: Record<string, string>;
}

function create(config?: ProgressConfig): ProgressBar;
import * as Frogress from 'frogress-bar';

const progressBar = Frogress.create(config);
  • value: Defaults to 0.
  • total: Defaults to 100.
  • progressBarSize: Defaults to 50 (Depend on terminal size).
  • activeChar: Defaults to '█'.
  • inactiveChar: Defaults to '░'.
  • template: Template string. Defaults to '{progress}'.
  • placeholder: Key-Value data that replace of template's placeholders. Defaults to {}.

remove

Unmount & Remove specified ProgressBar from current context.

  • Parameters | Name | Type | Required | |:--|:--|:--| | progressBar | ProgressBar | Yes |
  • Return Value | Type | |:--| | void |
/* interfaces */

function remove(progressBar: ProgressBar): void;

removeAll

Unmount & Remove all progress bars from current context.

  • Return Value | Type | |:--| | void |
/* interfaces */

function removeAll(): void;

count

Returns the current instance count of the progress bar.

  • Return Value | Type | |:--| | number |
/* interfaces */

function count(): number;

setOptions

Applies the options to the Frogress container.

  • Parameters | Name | Type | Required | |:--|:--|:--| | options | ContainerOptions | Yes |
  • Return Value | Type | |:--| | void |
/* interfaces */

interface ContainerOptions {
  refreshRate: number;
}

function setOptions(options: ContainerOptions): void;
  • refreshRate: Defaults to 50.

ProgressBar.start

Render progress bar.

  • Parameters | Name | Type | Required | |:--|:--|:--| | options | ProgressValues | Yes |
  • Return Value | Type | |:--| | void |
/* interfaces */

interface ProgressValues {
  value: number;
  total?: number;
  placeholder?: Record<string, string>;
}

function start(values: ProgressValues): void;
  • value: current progress value.
  • total: total progress value.
  • placeholder: Key-Value data that replace of template's placeholders.

ProgressBar.update

Set new states and re-render progress bar.

  • Parameters | Name | Type | Required | |:--|:--|:--| | options | ProgressValues | Yes |
  • Return Value | Type | |:--| | void |
/* interfaces */

interface ProgressValues {
  value: number;
  total?: number;
  placeholder?: Record<string, string>;
}

function update(values: ProgressValues): void;
  • value: current progress value.
  • total: total progress value.
  • placeholder: Key-Value data that replace of template's placeholders.

ProgressBar.stop

Unmount progress bar.

[!NOTE]
If you want to exit the process, you should remove all of progress bars using remove() or removeAll()

function stop(): void;

Template

[!WARNING] If you use reserved placeholder name, it will be overwritten to internal value of Frogress.

const templateString = 'Template {label} {progress} | {test}';

progressBar.update({
  placeholder: {
    // Plain placeholder
    label: '#1',
    // Placeholder with color
    test: Frogress.color('Colored!!', '#00ffff'),
  },
});

// Preview
// Template #1 ██████████████░░░░░░░░░░░░░░░░ | Colored!!
  • Reserved placeholders
    • {progress}: Progress bar (required)
    • {value}: Current value
    • {total}: Total value
    • {percentage}: current / total * 100% value

Development

# Lint
yarn lint

# Build
yarn build

# Run demo code
yarn start demo/{name}.ts

Resources

  • Logo image generated by DALL-E

License

MIT