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

utilstrust

v0.1.0

Published

A lightweight, typed utility belt for modern TypeScript — arrays, objects, strings, functions, math & type checks. Zero dependencies.

Readme

utilstrust

Zero-dependency, tree-shakeable, TypeScript-first utility library inspired by Lodash.

Installation

npm install utilstrust
# or
pnpm add utilstrust
# or
yarn add utilstrust

Features

  • Zero dependencies — lightweight and self-contained
  • Tree-shakeable — import only what you need via sub-path exports
  • TypeScript-first — fully typed with generics and type guards
  • Dual format — ships ESM and CJS builds
  • 108+ utility functions across 6 categories

Usage

// Import everything
import { chunk, camelCase, debounce, isEmpty, clamp } from 'utilstrust';

// Or use sub-path imports for smaller bundles
import { chunk, groupBy, sortBy } from 'utilstrust/array';
import { pick, omit, deepClone } from 'utilstrust/object';
import { camelCase, kebabCase, slugify } from 'utilstrust/string';
import { debounce, throttle, memoize } from 'utilstrust/function';
import { isEmpty, isPlainObject, typeOf } from 'utilstrust/is';
import { clamp, sum, median } from 'utilstrust/math';

API Reference

Array (utilstrust/array)

| Function | Description | |---|---| | chunk(arr, size) | Split array into chunks of size | | compact(arr) | Remove falsy values | | flatten(arr) | Flatten one level | | flattenDeep(arr) | Recursively flatten | | unique(arr) | Remove duplicates | | uniqueBy(arr, fn) | Remove duplicates by key function | | groupBy(arr, fn) | Group elements by key function | | countBy(arr, fn) | Count elements by key function | | sortBy(arr, fn) | Sort by key function (returns new array) | | keyBy(arr, fn) | Index elements by key function | | partition(arr, fn) | Split into [truthy, falsy] | | intersection(...arrs) | Elements common to all arrays | | difference(arr, ...others) | Elements in first array not in others | | union(...arrs) | Unique elements across all arrays | | first(arr) / last(arr) | First/last element | | sample(arr) | Random element | | shuffle(arr) | Fisher-Yates shuffle (new array) | | take(arr, n) / drop(arr, n) | First n / skip first n elements | | zip(...arrs) / unzip(arr) | Zip/unzip arrays | | range(start, end, step) | Generate number range |

Object (utilstrust/object)

| Function | Description | |---|---| | pick(obj, keys) | Pick specified keys | | omit(obj, keys) | Omit specified keys | | merge(target, ...sources) | Shallow merge | | deepMerge(target, ...sources) | Deep recursive merge | | deepClone(value) | Deep clone via structuredClone | | get(obj, path, default?) | Get nested value by dot path | | set(obj, path, value) | Set nested value by dot path | | has(obj, path) | Check if nested path exists | | entries(obj) / fromEntries(entries) | Typed Object.entries/fromEntries | | mapValues(obj, fn) | Map over object values | | mapKeys(obj, fn) | Map over object keys | | filterObj(obj, fn) | Filter object entries | | invert(obj) | Swap keys and values | | freeze(obj) | Deep freeze object |

String (utilstrust/string)

| Function | Description | |---|---| | capitalize(str) / uncapitalize(str) | Capitalize/uncapitalize first letter | | camelCase(str) | fooBar | | pascalCase(str) | FooBar | | snakeCase(str) | foo_bar | | kebabCase(str) | foo-bar | | constantCase(str) | FOO_BAR | | titleCase(str) | Foo Bar | | truncate(str, length, suffix?) | Truncate with ellipsis | | padStart(str, len, char?) / padEnd(...) | Pad string | | trim(str) / trimChar(str, char) | Trim whitespace or specific char | | escapeHtml(str) / unescapeHtml(str) | HTML entity escaping | | escapeRegExp(str) | Escape regex special chars | | template(str, data) | Simple {{key}} template interpolation | | slugify(str) | URL-safe slug | | countOccurrences(str, sub) | Count substring occurrences |

Function (utilstrust/function)

| Function | Description | |---|---| | debounce(fn, ms) | Debounce with .cancel() | | throttle(fn, ms) | Throttle with .cancel() | | memoize(fn, keyFn?) | Memoize with .cache Map | | once(fn) | Call function only once | | delay(fn, ms, ...args) | Delayed invocation | | pipe(...fns) / compose(...fns) | Function composition | | noop / identity / constant(v) | Utility functions | | negate(fn) | Negate a predicate | | retry(fn, opts?) | Retry with exponential backoff | | withTimeout(fn, ms) | Timeout wrapper | | sleep(ms) | Promise-based delay |

Type Checking (utilstrust/is)

| Function | Description | |---|---| | isString / isNumber / isBoolean | Primitive type guards | | isBigInt / isSymbol | Primitive type guards | | isUndefined / isNull / isNil | Nullish checks | | isFunction / isArray | Type guards | | isObject / isPlainObject | Object checks (excludes arrays) | | isDate / isRegExp / isError | Built-in object checks | | isMap / isSet / isWeakMap / isWeakSet | Collection checks | | isPromise | Promise-like check | | isEmpty | Empty check for strings, arrays, objects, maps, sets | | isInteger / isFinite / isNaN | Number checks | | typeOf(value) | Enhanced typeof returning specific types |

Math (utilstrust/math)

| Function | Description | |---|---| | clamp(value, min, max) | Clamp to range | | lerp(start, end, t) | Linear interpolation | | mapRange(value, inMin, inMax, outMin, outMax) | Map between ranges | | sum(arr) / average(arr) / median(arr) | Aggregations | | min(arr) / max(arr) | Min/max of array | | round(value, precision?) | Round to decimal places | | randomInt(min, max) / randomFloat(min, max) | Random numbers | | inRange(value, start, end) | Range check | | toRadians(deg) / toDegrees(rad) | Angle conversion | | percentage(value, total) | Percentage calculation | | gcd(a, b) / lcm(a, b) | GCD / LCM | | factorial(n) | Factorial |

License

MIT