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

@dinesh-gamage/cli-kit

v0.1.0

Published

Zero-dependency toolkit for friendly CLIs: colors, tables, spinners, progress bars, prompts, and logging with graceful non-TTY fallbacks

Readme

@dinesh-gamage/cli-kit

Zero-dependency toolkit for building friendly command-line tools: colors, tables, spinners, progress bars, prompts, and logging — with graceful non-TTY fallbacks so everything still behaves in CI, pipes, and log files (the usual reason spinners and progress bars "don't work").

Install

npm i @dinesh-gamage/cli-kit

Node 18+. ESM and CJS. No runtime dependencies.

Colors

import { c } from '@dinesh-gamage/cli-kit';

console.log(c.red.bold('error'), c.hex('#4f6df5')('brand'), c.bgBlue.white(' badge '));

Chainable styles, 16/bright/256/truecolor, correct nesting. Respects NO_COLOR, FORCE_COLOR, and TTY detection (colorSupport.enabled is mutable for tests).

Tables

import { printTable } from '@dinesh-gamage/cli-kit';

printTable(rows, {
  border: 'single',          // 'single' | 'compact' | 'none'
  index: true,               // 1-based # column
  columns: [{ key: 'name' }, { key: 'size', align: 'right', format: (v) => `${v} MB` }],
});

ANSI-aware widths (styled cells line up), wide-char/CJK/emoji safe, auto-shrinks to the terminal width, numeric columns right-align automatically, null renders as .

Spinner

import { createSpinner } from '@dinesh-gamage/cli-kit';

const spin = createSpinner('Installing…').start();
spin.update('Linking…');
spin.log('fetched 42 packages'); // permanent line above the spinner
spin.succeed('Done');            // or .fail() / .warn() / .info() / .stop()

In a TTY: animated frames. Not a TTY: one line at start, one at resolution — no control-character garbage in logs.

Progress bar

import { createProgressBar } from '@dinesh-gamage/cli-kit';

const bar = createProgressBar({ total: 100, label: 'migrate' });
bar.tick();          // or bar.update(42)

{bar} {pct} {current}/{total} {eta} format (customizable), rate/ETA from a moving average. Not a TTY: prints milestone lines at 0/25/50/75/100% instead of animating.

Prompts

import { input, password, confirm, select, multiselect } from '@dinesh-gamage/cli-kit';

const name = await input('Project name', { default: 'demo', validate: (v) => (v ? null : 'required') });
const secret = await password('API key');
const ok = await confirm('Continue?', { default: true });
const kind = await select('Template', [{ value: 'lib', label: 'Library', hint: 'tsup + vitest' }, 'cli']);
const feats = await multiselect('Features', ['lint', 'tests', 'ci'], { default: ['tests'] });

Arrow-key navigation, masked password input, Ctrl+C restores the terminal. Not a TTY: returns the provided default, or throws a clear error when there is none.

Logger

import { createLogger } from '@dinesh-gamage/cli-kit';

const log = createLogger({ level: 'info', timestamps: true });
log.info('3 modules registered');
log.success('applied', { ms: 182 });
log.warn('2 stale hints');       // → stderr
log.error('refused');            // → stderr
log.child('fin').info('scoped'); // [fin] prefix

Text helpers

wrap, truncate, pad, indent, heading, box — all ANSI-aware, all wide-char safe.

console.log(box('Hello!', { title: 'welcome' }));

What this package deliberately is not

Argument parsing is out of scope — pair it with commander. cli-kit is the presentation layer.

Demo

npm run demo          # in a terminal: full animations + interactive prompts
npm run demo | cat    # piped: watch every component fall back to plain lines

License

MIT