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

@billdaddy/arraykit

v0.1.1

Published

Tiny, type-safe array utilities — chunk, groupBy, keyBy, countBy, uniqueBy, partition, sortBy, zip, range, and numeric helpers. Zero dependencies.

Downloads

193

Readme

arraykit

All Contributors

Tiny, type-safe array utilitieschunk, groupBy, keyBy, countBy, uniqueBy, partition, sortBy, zip, range, and numeric helpers. Zero dependencies.

CI npm version bundle size types license

JavaScript got .flat(), .at(), and Object.groupBy — but you still reach for lodash the moment you need chunk, a stable multi-key sortBy, or keyBy. arraykit is that handful of everyday array helpers, tree-shakeable, fully typed, and zero-dependency — import only what you use.

import { chunk, groupBy, sortBy } from "@billdaddy/arraykit";

chunk([1, 2, 3, 4, 5], 2);                       // [[1, 2], [3, 4], [5]]
groupBy(users, (u) => u.role);                   // { admin: [...], user: [...] }
sortBy(users, (u) => u.lastName, (u) => u.age);  // stable, multi-key

Why arraykit?

  • The missing helpers. chunk, groupBy, keyBy, countBy, uniqueBy, partition, sortBy, zip, range, plus sum/mean/minBy/maxBy.
  • Pure & predictable. Nothing mutates its input; selectors get the index too.
  • Stable, multi-key sortBy. Pass several selectors; ties fall through in order.
  • Strong types. zip infers a tuple type, groupBy/keyBy return records, minBy/maxBy return T | undefined.
  • Tree-shakeable. sideEffects: false, ESM + CJS, zero dependencies.

Install

npm install @billdaddy/arraykit
# or: pnpm add @billdaddy/arraykit  /  yarn add @billdaddy/arraykit  /  bun add @billdaddy/arraykit

Grouping & dedupe

import { chunk, groupBy, keyBy, countBy, partition, uniqueBy } from "@billdaddy/arraykit";

chunk([1, 2, 3, 4, 5], 2);                 // [[1, 2], [3, 4], [5]]
groupBy([1, 2, 3, 4], (n) => n % 2 ? "odd" : "even"); // { odd: [1,3], even: [2,4] }
keyBy([{ id: "a" }, { id: "b" }], (x) => x.id);       // { a: {...}, b: {...} }
countBy(["a", "b", "a"], (x) => x);        // { a: 2, b: 1 }
partition([1, 2, 3, 4], (n) => n % 2 === 0); // [[2, 4], [1, 3]]
uniqueBy([{ id: 1 }, { id: 1 }, { id: 2 }], (x) => x.id); // [{id:1}, {id:2}]
uniqueBy([1, 1, 2, 3]);                    // [1, 2, 3]  (identity)

Ordering

import { sortBy, zip, range } from "@billdaddy/arraykit";

sortBy(people, (p) => p.age);              // ascending, original untouched
sortBy(people, (p) => p.last, (p) => p.age); // last name, then age

zip([1, 2, 3], ["a", "b", "c"]);           // [[1,"a"], [2,"b"], [3,"c"]]

range(4);        // [0, 1, 2, 3]
range(2, 6);     // [2, 3, 4, 5]
range(0, 10, 2); // [0, 2, 4, 6, 8]
range(3, 0);     // [3, 2, 1]

Numerics

import { sum, sumBy, mean, minBy, maxBy } from "@billdaddy/arraykit";

sum([1, 2, 3]);                  // 6
sumBy(carts, (c) => c.total);    // total of totals
mean([2, 4, 6]);                 // 4
minBy(users, (u) => u.age);      // youngest (or undefined)
maxBy(users, (u) => u.age);      // oldest

mean([]) is NaN; minBy/maxBy of an empty array are undefined; ties keep the first occurrence.

Pairs well with

| Need | Use | | --- | --- | | Deep equal / clone of elements | equalkit | | Read/write nested fields by path | dotpathkit |

Contributors ✨

This project follows the all-contributors specification. Contributions of any kind are welcome — code, docs, bug reports, ideas, reviews! See the emoji key for how each contribution is recognized, and open a PR or issue to get involved.

Thanks goes to these wonderful people:

License

MIT © Tung Tran