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

@trt-web/cli

v1.1.3

Published

README-driven CLI and static documentation tools for TypeScript libraries.

Readme

@trt-web/cli

Introduction

  • @trt-web/cli is a TypeScript toolkit for building interactive package CLIs and static documentation from README content.
  • It keeps package discovery, utility descriptions, methods, and examples close to the source README.
  • Use it to expose consistent list, info, docs, and help experiences for libraries in a monorepo or standalone package.

Why @trt-web/cli?

  • README-driven documentation with a predictable structure.
  • Interactive utility discovery for developers.
  • Static HTML output with code highlighting and copyable examples.
  • Reusable building blocks for package-specific CLIs.

Install

npm install @trt-web/cli
yarn add @trt-web/cli
bun add @trt-web/cli

For Contributors


TrtCommand

Creates an interactive CLI from a package README and package metadata. The README is the source of truth for utility groups, methods, descriptions, and examples.

Methods

  • startCli(config: CliConfig): Promise<void>: start an interactive CLI for a package.

Example

import { TrtCommand } from '@trt-web/cli';

await TrtCommand.startCli({
  readmePath: '../README.md',
  packageJsonPath: '../package.json',
  name: 'trt-browser',
  codeTheme: 'vs-code-dark-modern',
  docs: {
    outputPath: './dist/docs/browser',
    title: '@trt-web/browser',
  },
});

The generated CLI supports:

  • list: browse utility groups and inspect utility details.
  • info <utility>: show one utility's methods and README examples.
  • docs: generate a static HTML documentation site when docs is configured.
  • --version: show the package version and utility count.
  • --help: show available options and commands.

DocGenerator

Generates a static HTML documentation site from a package README.

Methods

  • generate(config: DocGeneratorConfig): void: parse a README and write the generated index.html.

Example

import { DocGenerator } from '@trt-web/cli';

DocGenerator.generate({
  readmePath: './README.md',
  outputPath: './dist/docs',
  title: '@trt-web/core',
  codeTheme: 'vs-code-dark-modern',
});

README structure

Each documented utility should use a heading, description, methods, and examples:

## LocalStorage

Typed browser storage helpers.

### Methods

- `set<T>(key: string, value: T): void`: store typed data.

### Examples

```ts
LocalStorage.set('profile', { id: 1, name: 'Alice' });
```

Code examples may use ts, js, html, css, scss, or bash fences. Multiple examples under one utility are preserved in their original order.


Supported code highlighting languages

Highlighter currently supports syntax highlighting for:

  • ts: TypeScript.
  • js: JavaScript.
  • html: HTML.
  • css: CSS.
  • scss: SCSS.
  • bash: Bash and common package or shell commands.

Highlighting is available for both terminal ANSI output and generated HTML documentation. Use theme: 'none' to keep the source unchanged.


Reusing Highlighter

import { Highlighter } from '@trt-web/cli/highlighter';

import '@trt-web/cli/highlighter.css';

const html = Highlighter.highlight(
  { content: 'const answer: number = 42;', language: 'ts' },
  { output: 'html', theme: 'vs-code-dark-modern' },
);