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

@gabreusi/hyrax

v1.0.0-rc.1

Published

TypeScript utilities that are short to call and safe to call: every input shape accepted, every shape typed exactly, a defined answer for every input. Zero dependencies.

Readme

Hyrax

npm CI License: MIT Docs

A TypeScript toolkit whose functions are short to call and safe to call. Each one accepts its input in every shape it really comes in, types each shape exactly, and has a defined answer for every input its types allow. Zero runtime dependencies. Works in Node, browsers, Deno and Bun.

Status: release candidates of 1.0 are on npm; npm install @gabreusi/hyrax@rc gets the newest one. The old 0.x code (@gpsign/hyrax) lives at the git tag legacy-0.6.1.

Install

npm install @gabreusi/hyrax

The idea

Every function in Hyrax follows two rules.

It takes input in the shapes it really comes in, and types each shape exactly. The common case gets a short signature and the full form stays available. Overloads keep every form precise, the compiler infers the generics, and the return type already lists every value that can come back, fallbacks included.

It has an answer for every input its types allow. Bounds work in either order, degenerate input gives a neutral result instead of NaN or an endless loop, a missing target is a no-op, and code that needs a browser falls back on the server instead of throwing. Hyrax throws only for a configuration no correct program can write, because hiding a bug is worse than reporting it.

import { clamp, range, Random, StringBuilder, toKebabCase, toNumber } from "@gabreusi/hyrax";

clamp(15, 10); // => 10
clamp(5, 10, 0); // => 5
range(5, 0, 2); // => [5, 3, 1]
toNumber("abc"); // => 0
toKebabCase("Hello World"); // => "hello-world"

const rng = new Random("level-1"); // the same seed gives the same numbers, in every runtime
rng.int(1, 100); // => 25

const classes = new StringBuilder().append("btn").if(true, "btn--primary").build(); // => "btn btn--primary"

The full list of rules, with the reason for each, is in AGENTS.md.

Entrypoints

| Import | Runs in | Contents | | ----------------------- | ------------------------- | ------------------------------------------------------------- | | @gabreusi/hyrax | Anywhere | Numbers, strings, Random, StringBuilder, Suspend | | @gabreusi/hyrax/dom | Browsers | listen, onClickOutside, setCSSVar, readStorage... | | @gabreusi/hyrax/react | React 18+ (optional peer) | useEventListener, useClickOutside, useInterval, hx... |

Documentation

The guides, the design notes, the migration guide from 0.x and the generated API reference are at https://gabreusi.github.io/hyrax/. Every example in them is type-checked against the built package, and the ones for the core are run.

Requirements

Node 20 or newer. TypeScript consumers need moduleResolution set to node16, nodenext or bundler (the /dom and /react subpaths use the package exports map).

Development

See CONTRIBUTING.md.

License

MIT