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

fovea-stream

v0.2.0

Published

Incremental fixation-point emphasis for streaming, ANSI-coloured output — tracks SGR state and holds back partial words across chunk boundaries.

Downloads

336

Readme

fovea-stream

Incremental fixation-point emphasis for text that arrives in pieces and is already coloured — the transform behind fovea.

npm install fovea-stream
import { BionicTransform } from "fovea-stream";

const transform = new BionicTransform({ style: "dim-tail" });
for await (const chunk of source) process.stdout.write(transform.feed(chunk));
process.stdout.write(transform.flush());

There is a Node stream wrapper too:

import { foveaStream } from "fovea-stream";

process.stdin.pipe(foveaStream()).pipe(process.stdout);

Why this is not just toAnsi in a loop

Transforming a finished string never has to deal with either of these:

  • Chunks split anywhere. A word or an escape sequence can straddle the boundary. Incomplete tails are held back and emitted once whole, capped so a long run of non-word bytes cannot stall the stream.
  • The text is already styled. SGR 22, which ends a bold stem, also clears dim. Emphasizing one word inside dim text would silently un-dim the rest of the line, so the active attributes are tracked and re-asserted after every stem. Bytes inside escape sequences are never treated as text.

Attributes are held in fixed slots rather than an accumulated string, so a long session with thousands of colour changes stays bounded.

Options

Everything fovea-core accepts, plus:

| Option | Default | Meaning | | --- | --- | --- | | style | "bold" | bold, dim-tail, or both | | codeDetection | "auto" | auto, fences, or off |

codeDetection keeps whole code blocks unemphasized. fences follows Markdown fences, which survive in piped output. auto adds a painted background as a second signal, for agents that have already rendered their Markdown to ANSI and left no fences behind — a heuristic, so right most of the time rather than always. Classification reads only the first few characters of a line, so output is never buffered to the next newline.

dim-tail fades the back of each word instead of bolding the front. On terminals whose bold is a brighter colour rather than a heavier weight, it is often the only one that reads at all.

MIT