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

async-iterable-sequencer

v0.0.1

Published

A TypeScript library for dynamically sequencing multiple async iterables implementing the relay pattern. Chain iterables to a sequencer and consume them in order as a single async iterable.

Readme

Async Iterable Sequencer

A TypeScript library for dynamically sequencing multiple async iterables implementing the relay pattern. Chain iterables to a sequencer and consume them in order as a single async iterable.

Features

  • Dynamic composition: Add iterables to the sequencer at runtime, even during consumption
  • Memory efficient: O(1) memory usage during consumption, independent of data volume
  • Type-safe: Seamless handling of both sync and async iterables
  • Sequential processing: Iterables are consumed in the order they were chained
  • Broadly compatible: Works with any async iterable including generators, arrays, and streams

Installation

npm install async-iterable-buffer
yarn add async-iterable-buffer

Usage

import { AsyncIterableSequencer } from 'async-iterable-buffer';

const sequencer = new AsyncIterableSequencer<number>();

// Chain synchronous iterables
sequencer.chain([10, 20, 30].values());

// Chain asynchronous iterables
sequencer.chain(async function* () {
  yield 40;
  yield 50;
  yield 60;
}());

// Signal end of input
sequencer.chain(null);

// Consume all values in order
for await (const value of sequencer) {
  console.log(value); // 10, 20, 30, 40, 50, 60
}

Behavior

The sequencer processes iterables in the order they were chained. Each iterable is fully consumed before moving to the next one. Both synchronous and asynchronous iterables are supported seamlessly and can be chained in any context.

API Reference

Exports

asyncIterableSequencer<T>(): AsyncIterableSequencerReturn

A class that sequences multiple iterables and exposes them as a single async iterable.

Types

AsyncIterableSequencerReturn

Type signature of returned object. Includes the sequence generator and chain function for adding iterables to the sequence chain.

sequence: A generator that returns the chained iterable contents in order.

chain: Chains an iterable to the sequencer. Pass null to signal the end of input and end the sequence chain.

interface AsyncIterableSequencerReturn<T> {
  sequence: AsyncGenerator<T>;
  chain: Chain<T>;
}

AnyIterable<T>

Type that accepts both sync and async iterables.

type AnyIterable<T> = AsyncIterable<T> | Iterable<T>

Chainable<T>

Types that can be called on chain. null ends the chain.

type Chainable<T> = AnyIterable<T> | null

Chain<T>

Function signature for the chain function.

type Chain<T> = (iterator: Chainable<T>) => void;

License

MIT © Tim Etler