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 🙏

© 2024 – Pkg Stats / Ryan Hefner

cli-progress-footer

v2.3.3

Published

[![Build status][build-image]][build-url] [![Tests coverage][cov-image]][cov-url] [![npm version][npm-image]][npm-url]

Downloads

4,026,967

Readme

Build status Tests coverage npm version

cli-progress-footer

Manage dynamic progress content below std output stream

Content agnostic. For reliable output all of process std output needs go through this utility. To ensure that by default process.stdout.write is overriden and process.stderr is redirected into process.stdout (with possibility to opt out from both).

Installation

npm install cli-progress-footer

Usage

const cliProgressFooter = require("cli-progress-footer")();

// Write progress
cliProgresssFooter.updateProgress("# processing 1\n# processing 2\n# processing 3\n");
...
// Update progress content when necessary
cliProgresssFooter.updateProgress("# processing 2\n# processing 3\n# processing 4\n");
...
// Update progress content when necessary
cliProgresssFooter.updateProgress("# processing 3\n# processing 4\n");

By default both stdout and stderr output is automatically handled and ensured to appear above progress content

Options

overrideStdout bool (default: true)

Whether to override data written to process.stdout stream so it appears in all cases above progress bar. Modified writes are passed immediately to native process.stdout.write so there's no risk of losing some log content or seing it out of sync

You may opt out but then if any content is written to process.stdout, process output may appear as not reliable.

When opting out you may write regular log content via cliProgressFooter.writeStdout(data)

redirectStderr bool (default: true)

When progress footer is in play, all output should be treated as one std stream. If it's not the case then any stderr output may break visible log output. Therefore by default all stderr content is redirected to stdout.

If you wish to redirect stderr somewhere else with cli means, then it's best turn this function off (so proces.stderr.write is not overriden)

discardStdin bool (default: true)

Whether to mute stdin input (so it doesn't add to displayed progress output). In scope of that setting also cursor is hidden

workaroundChildProcess bool (default: true)

Whether to hide a progress bar for a time being of child process runs with inherited stdio.

Problem is that output of such processes cannot be controlled, and if happens will break the progress bar output.

Internal workaround is to decorate child_process module functions, and react accordingly whenever problematic child process is created

Throbber animation

Additionally each progress line may be automatically prefixed with throbber (frames customizable at cliProgresssFooter.progressAnimationPrefixFrames), for that apply following setting:

cliProgressFooter.shouldAddProgressAnimationPrefix = true;

Tests

npm test