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

@azlib/std

v0.5.0

Published

Language-level helpers for arrays, objects, strings, numbers, and functions. Pure functions by default, with an opt-in `Array.prototype` patch for method-style calls.

Readme

@azlib/std

Language-level helpers for arrays, objects, strings, numbers, and functions. Pure functions by default, with an opt-in Array.prototype patch for method-style calls.

Date/time belongs in @azlib/temporal. Validation belongs in @azlib/validator.

Install

pnpm add @azlib/std

Pure functions

import {
  shuffle,
  unique,
  difference,
  intersection,
  union,
  sortBy,
  countBy,
  sum,
  mean,
  zip,
  zipObject,
  pick,
  omit,
  pickBy,
  omitBy,
  compactObject,
  merge,
  isEqual,
  cloneDeep,
  get,
  set,
  unset,
  has,
  flattenObject,
  unflattenObject,
  asRecord,
  asArray,
  asString,
  asNumber,
  asInteger,
  asBoolean,
  asError,
  isNil,
  isDefined,
  isPrimitive,
  isPromise,
  isError,
  isPlainObject,
  capitalize,
  kebabCase,
  snakeCase,
  camelCase,
  pascalCase,
  constantCase,
  titleCase,
  escapeRegExp,
  escapeHtml,
  unescapeHtml,
  slugify,
  template,
  dedent,
  mask,
  clamp,
  inRange,
  round,
  randomInt,
  mapRange,
  normalize,
  debounce,
  throttle,
  retry,
  timeout,
  parallel,
  memoize,
  attempt,
  tryOr,
  pipe,
  compose,
} from "@azlib/std";

// Objects
pick({ a: 1, b: 2 }, ["a"]);
omit({ a: 1, b: 2 }, ["b"]);
compactObject({ a: 1, b: null, c: undefined }); // { a: 1 }
isEqual({ a: [1, 2] }, { a: [1, 2] }); // true
cloneDeep({ a: new Set([1, 2]) });
get({ a: { b: 1 } }, "a.b");
set({ a: { b: 1 } }, "a.b", 2);
unset({ a: { b: 1 } }, "a.b");
has({ a: { b: 1 } }, "a.b"); // true

// Arrays
difference([1, 2, 3], [2]); // [1, 3]
intersection([1, 2, 3], [2, 3, 4]); // [2, 3]
union([1, 2], [2, 3]); // [1, 2, 3]
sortBy([{ age: 30 }, { age: 20 }], (x) => x.age);
countBy(["apple", "banana", "avocado"], (s) => s[0]); // { a: 2, b: 1 }
sum([1, 2, 3, 4]); // 10
mean([2, 4, 6]); // 4

// Strings & Numbers
slugify("Café & Restaurant — NY!"); // "cafe-restaurant-ny"
escapeHtml("<script>"); // "&lt;script&gt;"
template("Hello {user.name}", { user: { name: "Alex" } }); // "Hello Alex"
randomInt(1, 10); // 1..10
mapRange(5, 0, 10, 100, 200); // 150

// Functions & Async
const [err, data] = attempt(() => JSON.parse('{"a":1}'));
await retry(async () => fetchData(), { retries: 3 });
await parallel([1, 2, 3, 4], 2, async (id) => process(id));

Importing @azlib/std never mutates built-in prototypes.

Opt-in array patch

import { patchArray } from "@azlib/std/array/patch";

patchArray();
[1, 2, 3, 4].take(2);
[1, 2, 3].difference([2]); // [1, 3]
[1, 2, 3, 4].sum(); // 10

AI Agent Quick Reference

| Export | Description | | --- | --- | | shuffle / chunk / unique / groupBy / countBy | Array transforms & groupings | | difference / differenceBy / intersection / union / symmetricDifference | Set operations on arrays | | sortBy / take / drop / takeWhile / dropWhile / compact / partition | Array slicing, ordering & filtering | | sum / sumBy / mean / meanBy / minBy / maxBy | Collection math aggregations | | zip / unzip / zipObject / intersperse / range / sample | Array structuring & sampling | | pick / omit / pickBy / omitBy / compactObject | Object selection & sanitization | | merge / cloneDeep / isEqual / invert / defaults | Deep object merging, cloning & equality | | get / set / unset / has / flattenObject / unflattenObject | Path-based access & nesting transforms | | asRecord / asArray / asString / asNumber / asInteger / asFloat / asBoolean / asError | Unknown → typed coercion (JSON/API mapping) | | isNil / isDefined / isPrimitive / isPromise / isError / isPlainObject | Type guards & runtime checks | | capitalize / truncate / words / titleCase / dedent | String basics & formatting | | kebabCase / snakeCase / camelCase / pascalCase / constantCase | Case converters | | escapeRegExp / escapeHtml / unescapeHtml / slugify / template / mask | String escaping, slugification & templating | | clamp / lerp / inRange / round / random / randomInt / mapRange / normalize / isEven / isOdd | Number & range helpers | | debounce / throttle / once / noop / identity / sleep | Core function utilities | | retry / timeout / parallel / deferred / memoize / attempt / tryOr / tryOrAsync / pipe / compose / negate / times | Async & functional flow helpers | | patchArray / unpatchArray | From @azlib/std/array/patch |