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

@compdict/cli

v0.1.1

Published

Command-line conformance checker, encoder and inspector for RFC 9842 Compression Dictionary Transport.

Readme

@compdict/cli

The compdict command-line tool and programmatic API. It checks live RFC 9842 origins, creates dcb and dcz artifacts, inspects streams, evaluates match patterns, and runs a local test origin.

Requires Node.js 22 or later.

Most command-line users should install the unscoped compdict package:

npx compdict validate https://example.com/static/app.v2.js

Install @compdict/cli directly when you want to call commands from Node.js:

npm install @compdict/cli
import { renderJson, runValidate } from '@compdict/cli';

const { report, exitCode } = await runValidate({
  url: 'https://example.com/app.v2.js',
  dictionaryUrl: 'https://example.com/app.v1.js',
  encodings: ['dcb', 'dcz'],
  protocols: ['http/1.1', 'h2'],
  repeat: 1,
  json: true,
  allowWarnings: false,
  quiet: false,
  color: 'never',
  verbose: false,
});

process.stdout.write(renderJson(report));
process.exitCode = exitCode;

Programmatic commands return { report, exitCode }; they do not write the report to standard output. The exported command functions are:

When ValidateOptions.dest is omitted, runValidate() first uses a supplied dictionary's first recognised matching match-dest. It otherwise infers script or style from the resource pathname's .js or .css extension and defaults to document. Query parameters and fragments are ignored.

Identical findings from the HTTP/1.1 and HTTP/2 test matrices are collapsed into one report entry. finding.data.testCases lists the protocols where the finding occurred.

The CLI's default protocol mode tries h2, then falls back to HTTP/1.1 if h2 cannot complete. Programmatic callers can request the same behaviour with protocols: ['h2', 'http/1.1'] and protocolFallback: true. Savings are measured on the first successful protocol using clean identity and gzip, br, zstd requests plus isolated dcb and dcz requests.

runValidate() reports dictionary freshness and cacheability problems but still forces otherwise usable dictionary bytes through the diagnostic request matrix. Malformed, mismatched, unsafe, mutated or unsupported dictionaries remain blocked.

The synthetic SEC_FETCH_CROSS_ORIGIN probe is informational. Set pageUrl to an origin different from the resource to test a declared cross-origin deployment and retain warning severity. The probe sends that page origin in Origin and honours wildcard or exact Access-Control-Allow-Origin.

  • runValidate(options)
  • runEncode(options)
  • runInspect(options)
  • runMatch(options)
  • runServe(options)

runEncode() accepts hashSuffix: 'base64url' or hashSuffix: 'hex' to append the dictionary SHA-256 to the complete output path.

runServe() resolves after its listeners bind and returns their origins plus a close() method:

import { runServe } from '@compdict/cli';

const server = await runServe({
  port: 0,
  misconfigure: ['none'],
  tls: false,
  json: false,
  allowWarnings: false,
  quiet: false,
  color: 'never',
  verbose: false,
});

try {
  console.log(server.origins.http1, server.origins.h2c);
} finally {
  await server.close();
}

The package also exports raw transports, browser-like request header builders, human and JSON renderers, verdict helpers, and all command option types. The report schemas are exported as @compdict/cli/schema/report-1.0.0.json and @compdict/cli/schema/report-1.1.0.json.

The transport uses node:http, node:https, and node:http2 rather than fetch. It preserves raw, content-coded response bodies and gives the caller exact control over negotiation fields. HTTPS requests pin ALPN to the selected protocol. Cleartext requests select HTTP/1.1 or h2c directly.

Apache-2.0.