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

@omi-io/auxiliaries

v1.2.0

Published

Utility helpers for array checks, collections, memoization, text, and more.

Downloads

1,259

Readme

@omi-io/auxiliaries

Utility helpers for array checks, object collection helpers, memoization, text formatting, math, and small async/runtime utilities.

Install

yarn add @omi-io/auxiliaries

Usage

Import from the root entry:

import {
  clamp,
  memoizeArgs,
  pickExcept,
  throttle,
  formatNumber,
} from "@omi-io/auxiliaries";

Or import from focused subpaths:

import { isLastIndexOfArray } from "@omi-io/auxiliaries/check";
import { pickExcept, pick, omit } from "@omi-io/auxiliaries/collection";
import { clamp, measureExecutionTime } from "@omi-io/auxiliaries/measure";
import { delay, throttle, debounce } from "@omi-io/auxiliaries/serve";

API

check

  • isLastIndexOfArray(array, index, throws?) - Checks whether index is the last index in array.

collection

  • pickExcept(object, excludes) - Returns a shallow copy of an object excluding selected keys.
  • pick(object, keys) - Returns a shallow copy with only selected own keys present.
  • omit(object, keys) - Same as pickExcept (readable alias).

define

  • isDefinedAndNotNull(value) - True for values that are not undefined, null, or NaN.
  • isValueNonDefined(value, shouldCheckNaN?) - Helper for undefined/null/NaN checks.
  • isBrowser() - Detects browser runtime.
  • isDOMSupported() - Detects DOM support.
  • isTouchDeviceLikely() - Heuristic touch-device detection (browser-only).
  • isPwa() - Checks if app is running in standalone display mode.
  • isProbablyPwa() - Broader PWA heuristic including service worker checks.

log

  • echo(...args) - Alias for console.log.

measure

  • measureExecutionTime(fn, ...args) - Runs a function and logs elapsed execution time.
  • clamp(value, a, b) - Restricts value to the [min(a,b), max(a,b)] range.

memoize

  • memoizeArgs(fn) - Memoizes by serialized argument list.
  • memoizeSimpleTypeArg(fn) - Memoizes a single-argument function by argument identity.

serve

  • delay(milliseconds, result?) - Promise-based delay utility.
  • throttle(fn, ms) - Throttles function calls to at most once per interval.
  • debounce(fn, ms) - Invokes fn after ms ms have passed since the last call (trailing debounce).

text

  • capitalizeFirstLetter(text, restLowercase?) - Capitalizes first character.
  • convertSpacesToThinsp(text) - Converts regular spaces to  .
  • formatNumber(input, { format? }) - Formats numbers using <x,x.x> or <x x,x> pattern.

math

  • toUnsigned32BitInteger(value) - Converts value to unsigned 32-bit integer.
  • quantizeToDecimals(value, options?) - Quantizes to a fixed number of decimal places. options.mode is "round" | "floor" | "ceil" (default "round"); options.decimals defaults to 0.
  • roundToDecimalPlaces(value, decimalPlaces) - Rounds to a specific decimal precision (same as quantizeToDecimals with mode: "round").
  • wrapPeriodic(value, period) - Maps value into the half-open interval [0, period) (e.g. angles). Throws RangeError if period is not finite or not > 0.
  • lerp(a, b, t) - Linear interpolation a + (b - a) * t.
  • inverseLerp(a, b, value) - Parameter along the segment from a to b for value; returns 0 when a === b.
  • remap(value, inMin, inMax, outMin, outMax) - Maps from input range to output range; returns outMin if inMin === inMax.
  • approxEqual(a, b, epsilon?) - true when |a - b| <= epsilon (default 1e-10).

Example

import {
  clamp,
  memoizeArgs,
  pickExcept,
  quantizeToDecimals,
  roundToDecimalPlaces,
  wrapPeriodic,
} from "@omi-io/auxiliaries";

const safe = clamp(42, 0, 10); // 10
const rounded = roundToDecimalPlaces(3.14159, 2); // 3.14
const floored = quantizeToDecimals(1.236, { mode: "floor", decimals: 2 }); // 1.23
const angle = wrapPeriodic(-10, 360); // 350
const publicUser = pickExcept({ id: 1, email: "[email protected]", password: "x" }, ["password"]);

const slowSum = (a: number, b: number) => a + b;
const cachedSum = memoizeArgs(slowSum);
cachedSum(1, 2); // computed
cachedSum(1, 2); // cached