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

@ripl/utilities

v1.4.0

Published

Shared typed utility functions for Ripl

Readme

@ripl/utilities

npm license size

The typed helper functions every Ripl package is built from: type guards, numeric helpers, collection joins, comparators, caches and shared types.

This is an internal dependency. Every other @ripl/* package installs it, so you already have it transitively. Install it directly only if you want these helpers in your own code.

Features

  • Category-prefixed names — every runtime export starts with its category (type*, number*, array*, object*, set*, string*, function*, comparitor*, predicate*, value*, time*), so related helpers group together in autocomplete.
  • arrayJoin — the left/inner/right join Ripl's charts diff data with. A keyof predicate takes a Map-backed path, so a keyed join is linear rather than quadratic.
  • Numeric helpers for axes and scalesnumberExtent, numberNice (rounds to a 1/2/5/10 × power of ten), numberRoundTo, numberClamp, numberFormat.
  • Eight type guardstypeIsArray, typeIsBoolean, typeIsDate, typeIsFunction, typeIsNil, typeIsNumber, typeIsObject, typeIsString.
  • createLRUCache — a bounded Map subclass that evicts the least recently used entry when full. Iteration is least-recently-used first and does not itself affect recency.
  • Function helpersfunctionCache (holds a result until invalidated), functionMemoize (keyed by a resolver, first argument by default), functionProduce, functionIdentity, functionNoop.
  • Shared typesOneOrMore<T>, AnyFunction, AnyObject, Disposable, Predicate<L, R>, Indexer<T>, Merge<A, B>, plus GetReadonlyKeys/GetMutableKeys.
  • Zero dependencies, tree-shakable — no runtime dependencies at all, and each helper is a separate export.

Native array methods (forEach, map, filter, reduce, find, flatMap) and Math.min/Math.max are faster than wrappers, so this package has none. It ships only helpers that do something the platform does not.

Installation

# npm
npm install @ripl/utilities

# yarn
yarn add @ripl/utilities

# pnpm
pnpm add @ripl/utilities

Quick start

import {
    arrayJoin,
    numberExtent,
    numberNice,
} from '@ripl/utilities';

const {
    left: entries,
    inner: updates,
    right: exits,
} = arrayJoin(data, elements, (datum, element) => datum.id === element.data);

exits.forEach(element => element.destroy());

const [min, max] = numberExtent(data, datum => datum.value);
const axisMax = numberNice(max, true);

Key API

| Export | What it does | | --- | --- | | arrayJoin | Left/inner/right join for diffing data against drawn elements | | arrayGroup / arrayDedupe / arrayIntersection / arrayDifference | Grouping and set operations over arrays | | numberExtent / numberNice / numberClamp / numberFormat | The numeric helpers behind axes and scales | | typeIsArraytypeIsString | The eight type guards | | createLRUCache | Bounded, recency-ordered Map subclass | | functionCache / functionMemoize | Result caching and keyed memoization | | stringUniqueId | Cryptographically random hex id, 8 characters by default |

Related packages

  • @ripl/core — the rendering core, this package's only direct consumer of note
  • @ripl/web — the browser entry point, and what most projects should install
  • @ripl/charts — where arrayJoin does its data diffing

Documentation

The full API reference is at ripl.run/docs/api/@ripl/utilities.

License

MIT