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

@klodianimeri/pipejs

v1.0.3

Published

Pipe functions that provide convenient and efficient ways to work with iterators.

Readme

PipeJS

This package aims to unify piping functions for both sync and async generators. Ex: same sum() pipe that can be used for both generators.

The idea is to reduce the bundle sizes that comes from writing twice the same pipe to be used for sync and async code.

Installation

npm i @klodianimeri/pipejs

Sync

Signature

function* pipeSync(source: Iterable<any, any, unknown>, ...pipes: Array<Pipe>): Iterable<any, any, unknown>

Usage

import { pipeSync, filter, sum } from '@klodianimeri/pipejs';

let numbers = [...Array(100000).keys()];

let results = pipeSync(numbers,
    filter(x => x % 2 === 0),
    sum()
);

for (let item of results) {
    console.log(`Sum:`, item);
}

Async

Signature

async function* pipeAsync(source: AsyncIterable<any, any, unknown>, ...pipes: Array<Pipe>): AsyncIterable<any, any, unknown>

Usage

import { pipeAsync, filter, sum } from '@klodianimeri/pipejs';

async function* asyncRange(from, to) {
    for (let i = from; i < to; i++) {
        yield i;
    }
}

let results = pipeAsync(asyncRange(0, 100000),
    filter(x => x % 2 === 0),
    sum()
);

for await (let item of results) {
    console.log(`Sum:`, item);
}

Operators

at(index: number)
average()
bufferCount(count: number, every?: number)
concat(source: Iterable<any, any, unknown>)
count()
defaultIfEmpty(value: any)
difference(source: Iterable<any, any, unknown>)
distinctUntilChanged(comparator?: (previous: any, current: any) => boolean)
distinctUntilKeyChanged(key: string, comparator?: (previous: any, current: any) => boolean)
distinct(keyselector?: (element: any) => any)
drop(count: number)
elementAt(index: number)
endWith(...elements: Array<any>)
entries()
every(predicate: (element: any, index?: number) => boolean)
fill(value: any, start?: number, end?: number)
filter(predicate: (element: any, index?: number) => boolean)
findIndex(predicate: (element: any, index?: number) => boolean, fromIndex?: number)
findLastIndex(predicate: (element: any, index?: number) => boolean, fromIndex?: number)
findLast(predicate: (element: any, index?: number) => boolean)
find(predicate: (element: any, index?: number) => boolean)
first()
flat(depth?: number) *flats only arrays
ignoreElements()
includes(value: any, fromIndex?: number)
indexOf(value: any, fromIndex?: number)
intersection(source: Iterable<any, any, unknown>)
isDisjointFrom(source: Iterable<any, any, unknown>)
isEmpty()
isSubsetOf(source: Iterable<any, any, unknown>)
isSupersetOf(source: Iterable<any, any, unknown>)
keys()
lastIndexOf(value: any, fromIndex?: number)
last()
mapTo(value: any)
map(callbackFn: (element: any, index?: number) => any)
max()
min()
pop()
reduce(accumulator: (accumulator: any, currentValue: any, index?: number) => any, initialValue?: any)
reverse()
scan(accumulator: (accumulator: any, currentValue: any, index?: number) => any, initialValue?: any)
size()
skipLast(count: number)
skip(count: number)
slice(start: number, end?: number)
some(predicate: (element: any, index?: number) => boolean)
splice(start: number, deleteCount: number, ...elements: Array<any>)
startWith(...elements: Array<any>)
sum()
symmetricDifference(source: Iterable<any, any, unknown>)
takeLast(count: number)
takeWhile(predicate: (element: any, index?: number) => boolean, inclusive?: boolean)
take(count: number)
toArray()
toSet()
union(source: Iterable<any, any, unknown>)
values()

Browser

https://unpkg.com/@klodianimeri/pipejs@^1/dist/index.umd.js

The global namespace is pipejs:

const { pipeSync } = pipejs;

Build Statistics

Full package including all the operators:

       5 kB: index.cjs.gz
    4.55 kB: index.cjs.br
    3.31 kB: index.modern.js.gz
    3.05 kB: index.modern.js.br
    5.22 kB: index.module.js.gz
    4.76 kB: index.module.js.br
    5.04 kB: index.umd.js.gz
    4.59 kB: index.umd.js.br