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

@peerigon/typescript-toolkit

v4.4.0

Published

πŸ”§βœ¨ Tiny helpers for TypeScript applications

Readme

Features

  • 🎯 High-quality module design
  • ⚑ Lightweight sub-package exports
  • πŸ“¦ Tree-shakeable ES modules
  • βœ… Zero dependencies

Installation

npm install @peerigon/typescript-toolkit --save

Also available on JSR.

Usage

Import only the utilities you need. Each one is exposed as its own subpath:

import { assert } from "@peerigon/typescript-toolkit/assert";

Utilities

| Module | Description | Docs | | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------- | | api | Define a typed JSON API client with an overridable hook pipeline | β†’ | | api/rate-limit | Rate-limited fetch for defineApi (pacing + Retry-After) | β†’ | | api/result | defineApiResult β€” like defineApi, but returns Result.Sync | β†’ | | assert | Assert a value is not null or undefined, with TypeScript narrowing | β†’ | | assert-never | Assert a code path is unreachable, for exhaustive switch/case statements | β†’ | | concurrency/once | Run an async function at most once (single-flight + cache) | β†’ | | concurrency/once/result | once with a synchronous Result snapshot | β†’ | | concurrency/exactlyOnce | Invoke an async function exactly once; second call throws | β†’ | | concurrency/exactlyOnce/result | exactlyOnce with a synchronous Result snapshot | β†’ | | concurrency/mutex | Serialize async tasks (concurrency 1) | β†’ | | concurrency/rate-limit | Pace async task starts (max per sliding interval) | β†’ | | need | Assert a value is not null or undefined and return it with a narrowed type | β†’ | | no-null | Convert between null and undefined in JSON-like values (runtime + types) | β†’ | | dedupe | Remove duplicate values from an array while preserving first-occurrence order | β†’ | | emitter | Minimal typed event emitter with payload objects per event | β†’ | | enums | Lightweight string-enum alternative for erasableSyntaxOnly TypeScript projects | β†’ | | map-leaves | Deeply map leaves in JSON-like values (mutates arrays/objects in place) | β†’ | | match | Exhaustive pattern matching with compile-time case checks, similar to switch | β†’ | | metadata | Typed metadata attached to objects via per-channel WeakMap stores | β†’ | | namespace | Hierarchical namespaces with exclusive member claims and dotted prefixes | β†’ | | result | Type-safe error handling with pending, success, and error states | β†’ | | runtime | Generator-based runtime for the generator context pattern, with type-safe yield* | β†’ | | signals | Push-based reactive state with explicit watchers and signal.from adapters | β†’ | | sleep | Promise-based delay with optional AbortSignal cancellation | β†’ | | stable-stringify | Deterministic stringify for JSON + Map/Set/BigInt/Symbol/Date/RegExp | β†’ | | stable-stringify/json | JSON-only deterministic JSON.stringify with sorted object keys | β†’ | | unwrap | Extract values from Result or nullable types, with optional fallback support | β†’ |

License

MIT

Sponsors