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

@hyperjump/pact

v2.0.1

Published

Higher order functions for iterators and async iterators

Downloads

1,727,396

Readme

Hyperjump - Pact

Higher-order functions for iterators and async iterators. Each function is a step you put in a pipe. A pipeline does its work one value at a time, and only when a value is asked for.

Read the documentation at hyperjump.io

npm install @hyperjump/pact
import * as Pact from "@hyperjump/pact";

const numbers = new Set([1, 2, 3, 4, 5, 6, 7, 8, 9]);

Pact.pipe(
  numbers,
  Pact.filter((n) => n % 2 === 0),
  Pact.map((n) => n * 2),
  Pact.take(3),
  Pact.toArray
); // [4, 8, 12]

The pipeline reads the Set directly, without making arrays in between steps, and take(3) stops it at 6. Array methods would copy the Set into an array first, and then filter and map all of it.

  • Composable. Steps are plain functions. Use compose to build a pipeline without a source, then use it with as many sources as you like.
  • The platform's names. map, filter, take, flatMap, toArray, and the rest work like the native Iterator helpers. pact adds what the helpers don't have, like scan, takeWhile, zip, and toObject.
  • Sync and async. @hyperjump/pact/async has the same functions for async iterables. Its callbacks can return promises.
  • Closes what it opens. When a pipeline stops early, it closes the iterators it was reading. A generator's finally block runs.
  • Small and fast. No dependencies. TypeScript types included. Works in Node.js 24 or later and browsers.

Documentation

The documentation is at hyperjump.io/pact.

  • Install: Node.js, browsers, and TypeScript
  • Pipelines: pipe, compose, and what a step is
  • Transforming: map, filter, take, and the other steps
  • Sources: range, concat, zip, and zipKeyed
  • Collecting: toArray, reduce, find, and the other functions that end a pipeline
  • Async: async iterables, async callbacks, and mixing them with sync ones
  • Benchmarks: pipelines compared with array methods
  • Migrating from v1: what changed, and what to do about it

Using v1? See the v1 README.

Contributing

See design/ for how it works and why. The documentation's source is in website/.

npm install
npm test               # Run the tests
npm test -- --watch    # Run the tests when files change
npm run lint
npm run type-check
npm run check-website  # Check the examples in website/

License

MIT