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

@kud/cli-update

v0.1.0

Published

Tell users when a @kud CLI has an update, without blocking startup or corrupting piped output

Readme

TypeScript Node.js MIT

Tell users when a @kud CLI has an update, without blocking startup or corrupting piped output

Website · Documentation

Features

  • Never blocks startup — reads a cached answer from disk and returns instantly. A stale cache (24h by default) triggers a detached, unref'd background refresh; the fresh result appears on the next run, never the current one.
  • Silent on non-TTY output — returns null immediately whenever process.stdout.isTTY is false, so piped or redirected output (duux status --json | jq) is never touched.
  • Respects the ecosystem's opt-outs — stays quiet when CI or NO_UPDATE_NOTIFIER is set, on top of its own config file.
  • Per-package or global opt-out~/.config/kud/cli.json supports a global updateNotifier flag and per-package overrides, with disableNotices() / enableNotices() to manage it programmatically from a CLI's own subcommand.
  • Real semver comparison — uses the semver package to compare versions correctly, prereleases included, instead of a naive string check.
  • Never throws — a broken network, an unreachable registry, or a read-only home directory all degrade silently to null/no-op. An update check can never break the CLI that calls it.

Install

@kud/cli-update hasn't been published to npm yet — this is a pre-release library (0.1.0), still under review. Once it's published, install it as a normal dependency:

npm install @kud/cli-update

Until then, install straight from the repository:

npm install kud/cli-update

Usage

Call checkForUpdate once at CLI startup, and print the notice yourself if one comes back:

import { checkForUpdate, formatNotice } from "@kud/cli-update"
import pkg from "../package.json" with { type: "json" }

const notice = await checkForUpdate({ name: pkg.name, version: pkg.version })
if (notice) console.error(formatNotice(notice))

checkForUpdate always resolves — it never rejects, and it never waits on the network. formatNotice turns the result into a single line:

Update available: @kud/duux-cli 1.2.0 -> 1.3.0. Run `npm i -g @kud/duux-cli` to upgrade.

Opting out

A CLI can expose its own update --disable subcommand on top of the config file at ~/.config/kud/cli.json:

import { disableNotices, enableNotices, noticesEnabled } from "@kud/cli-update"

disableNotices()
disableNotices("@kud/duux-cli")
enableNotices("@kud/duux-cli")

noticesEnabled("@kud/duux-cli")

The first call turns off notices for every @kud CLI; passing a package name scopes it to just that one, and enableNotices reverses either. noticesEnabled reads the current state.

Per-package settings win over the global one. Users can reach the same switch directly, without any CLI-specific code, by editing the config file or setting NO_UPDATE_NOTIFIER=1:

{
  "updateNotifier": false,
  "packages": {
    "@kud/duux-cli": true
  }
}

API

type UpdateNotice = {
  name: string
  current: string
  latest: string
  command: string
}

checkForUpdate(options: { name: string; version: string; cacheHours?: number }): Promise<UpdateNotice | null>
formatNotice(notice: UpdateNotice): string
disableNotices(scope?: string): void
enableNotices(scope?: string): void
noticesEnabled(name: string): boolean

cacheHours defaults to 24 and controls how long a cached "latest version" answer is trusted before a background refresh is triggered.

Development

git clone https://github.com/kud/cli-update.git
cd cli-update
npm install
npm run build

npm test runs the Vitest suite, npm run build:watch rebuilds on change, and npm run typecheck runs a type-only check with no emit.

📚 Full documentation → cli-update/docs