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

console-static-text

v0.3.4

Published

Display text that stays at the bottom of the console.

Readme

console-static-text

JSR npm

For the Rust crate, go to console_static_text.

Install:

# jsr
deno add jsr:@david/console-static-text

# npm
npm install console-static-text

Library for displaying text that should stay at the bottom of the console. This measures words to handle wrapping and has some console resizing support. Example use might be for displaying progress bars or rendering selections.

Example

import { staticText } from "console-static-text";
import { delay } from "@std/async/delay";

using scope = staticText.createScope();

scope.setText([
  "Some text",
  "Some very long text. ".repeat(10),
  () => `Time is: ${new Date()}`,
  (consoleSize) => `Console size: ${consoleSize.rows}, ${consoleSize.columns}`,
  () => {
    // or deferred and multiple lines.
    return [
      "Line 1",
      (consoleSize) => (Math.random() * consoleSize.columns!).toString(),
    ];
  },
]);
staticText.refresh(); // now draw to console window

await delay(1_000);
scope.logAbove("Hello!"); // this will be logged immediately above the other text

Render interval

You can start a render interval for the duration of some work:

import { renderInterval, staticText } from "console-static-text";
import { delay } from "@std/async/delay";

// defaults to 60
renderInterval.intervalMs = 30;

async function download() {
  using _renderScope = renderInterval.start(); // updates the displayed text periodically
  // make sure these are after so it's disposed before the render scope
  using timeScope = staticText.createScope();
  using downloadScope = staticText.createScope();
  const startTime = Date.now();
  timeScope.setText(() => `It's been ${Date.now() - startTime}ms`);
  for (let i = 0; i < 100; i++) {
    downloadScope.setText(`Downloading ${i}/100...`);
    await delay(30); // do some async work
  }
}

// will show the Downloading x/100... text for the duration
// of the function call and then clear the text on exit
await download();

Note this won't render if there's any blocking synchronous work. To do that, you must force a refresh via staticText.refresh().

Hanging indentation

Hanging indentation is possible by providing TextItem objects.

import { staticText } from "console-static-text";

using scope = staticText.createScope();

scope.setText([{
  text: "Some non-hanging text.",
}, {
  text: "Some long text that will wrap at a certain width.",
  hangingIndent: 4,
}]);

staticText.refresh(); // draw to console window

This is useful when implementing something like a selection UI where you want text to wrap with hanging indentation.

Singleton and instances

By default, the library has two exports that are singletons around stderr—staticText and renderInterval. These are an instance of StaticTextContainer and RenderInterval respectively. New instances of these classes can be created and used instead of the singletons if you wish.