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 🙏

© 2024 – Pkg Stats / Ryan Hefner

iterable-joiner

v1.0.3

Published

combine multiple Iterable or AsyncIterable objects into one

Downloads

11

Readme

iterable-joiner

What's included?

Two AsyncIterable Joiner Implementations

  • IterableJoiner.Async.Equitable - provides values from all AsyncIterables with the same priority.
  • IterableJoiner.Async.Priority - provides values from all AsyncIterables with priority given to the first AsyncIterable with decreasing priority for each subsequent AsyncIterable.

Two Iterable Joiner Implementations

  • IterableJoiner.Sync.Equitable - provides values from all Iterables in a round-robin fashion.
  • IterableJoiner.Sync.Priority - provides values from all Iterables exhausting each Iterator before continuing to the next.

Abstract joiners

  • Write your own algorithm for how to iterate through multiple iterators.

Importing

const { IterableJoiner } = require ( "iterable-joiner" );
import { IterableJoiner } from "iterable-joiner";

IterableJoiner.Async

IterableJoiner.Async.Equitable.join( [ ... asyncIterables ] )

IterableJoiner.Async.Priority.join( [ ... asyncIterables ] )

  • asyncIterables <AsyncIterable[]> (optional) one or more asyncIterables that you want to join.
  • Returns <AsyncIterable> an aggregation of the provided AsyncIterables.

asyncJoiner.iterables

  • a read-only in-order array of the iterables that have been added to the joiner

asyncJoiner.addIterable( asyncIterable[, idx ] )

  • asyncIterable <AsyncIterable> the asyncIterable being added.
  • idx <number> (optional) the index of the internal array to add the iterable at. If idx>0, the value will be unshifted onto the front of the array, if idx>iterables.length, it will be pushed. Default is to push to the end of the array.
  • Returns <boolean> false if parameters have incorrect types or the asyncIterator has already been added

asyncJoiner.removeIterable( asyncIterable )

  • asyncIterable <AsyncIterable> the asyncIterable being removed
  • Returns <boolean> false if asyncIterator doesn't exist in the joiner

IterableJoiner.Sync

IterableJoiner.Sync.Equitable.join( [ ... iterables ] )

IterableJoiner.Sync.Priority.join( [ ... iterables ] )

  • iterables <Iterable[]> (optional) one or more asyncIterables that you want to join.
  • Returns <Iterable> an aggregation of the provided Iterables.

syncJoiner.iterables

  • a read-only in-order array of the iterables that have been added to the joiner

syncJoiner.addIterable( iterable[, idx ] )

  • iterable <Iterable> the Iterable being added.
  • idx <number> (optional) the index of the internal array to add the iterable at. If idx>0, the value will be unshifted onto the front of the array, if idx>iterables.length, it will be pushed. Default is to push to the end of the array.
  • Returns <boolean> false if parameters have incorrect types or the iterator has already been added

syncJoiner.removeIterable( iterable )

  • iterable <Iterable> the Iterable being removed
  • Returns <boolean> false if Iterator doesn't exist in the joiner