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

@kaged/utils

v0.0.2

Published

Shared foundation utilities — fs guards, type guards, formatting, async/stream helpers, Snowflake IDs, fetch-retry, rotating logger, XDG dirs, and more

Downloads

442

Readme

影 @kaged/utils

shadow ops for your [foundation]

The shared utility belt of kaged — fs guards, type guards, formatting, async/stream helpers, Snowflake IDs, fetch-retry, a rotating logger, XDG dirs, and more. Zero dependencies, Bun-first.

npm license runtime


what it is

The foundation package every kaged service and plugin leans on. No frameworks, no transitive dependency tree — just typed, tested primitives shipped as TypeScript source (main: src/index.ts), ready for Bun to run directly.

> 影 @kaged/utils
> guards ............ fs error codes, runtime type guards
> async ............. timeouts, aborts, retries, streams
> id ................ snowflake generation + validation
> logger ............ structured JSONL, daily rotation
> dirs .............. XDG-aware kaged directories
> system nominal.

install

bun add @kaged/utils

what's in the box

| Module | What you get | |---|---| | abortable | AbortError, abort-aware stream/operation wrappers | | async | promise timeouts with abort signals, listener-safe cleanup | | dirs | XDG-aware kaged directories (getDataDir, getStateDir, …) | | env | env var name validation and safety checks | | fetch-retry | fetch with retry, backoff, and Retry-After hint extraction | | format | human-readable durations ("1.5s", "2h30m", "3d2h") and friends | | frontmatter | YAML frontmatter build/parse round-trip | | fs-error | typed fs error guards — isEnoent(err) instead of message matching | | glob | gitignore-style path globbing helpers | | id | Snowflake IDs — snowflake(), isValidSnowflake() | | json | tryParseJson<T>() and safe JSON helpers | | logger | structured rotating file logger — JSONL, daily rotation, Bun-native I/O | | mime | mime type tables and image type guards | | peek-file | sniff a file's head without reading the whole thing | | postmortem | process cleanup registration + postmortem reasons | | ring | RingBuffer<T> | | sanitize-text | control-character and text sanitization | | stream | line readers, SSE parsing, JSONL parsing | | temp | TempDir — self-cleaning temp directories | | type-guards | isRecord, asRecord, and friends | | which | resolve executables on PATH |

Everything is exported from the root barrel:

import { snowflake, isEnoent, fetchWithRetry } from "@kaged/utils";

development

bun install
bun test            # 340 tests
bun run typecheck
bun run format      # biome

release

Bump version in package.json, tag v<version>, push the tag. CI verifies the tag matches, runs the suite, and publishes to npm with provenance.


license

AGPL-3.0 © the kaged project

[kaged] · kaged.dev · sanctioned edge, sacred code