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

@luaks/pipe

v1.0.3

Published

This library intends to replicate [ES Pipeline Operator](https://github.com/tc39/proposal-pipeline-operator) in a somewhat fluent fashion.

Downloads

31

Readme

@luaks/pipe

This library intends to replicate ES Pipeline Operator in a somewhat fluent fashion.

It is designed to be simple, and is considered to have its fulfilled goal.

Usage

Install the library using $ npm install @luaks/pipe. Pass the initial value to the pipe function and call through on the outgoing pipe with the modifying functions.

Example:

pipe('  this is a  long    string')
    .through(
        value => value.trim(),
        value => value.toUpperCase(),
        value => value.replace(/\s{2,}/, ' ')
    )

It is also recommended to further wrap the functions in parameterized functions, to have more readable code. For example:


function trim() {
    return value => value.trim();
}

function toUpperCase() {
    return value => value.toUpperCase();
}

function replace(pattern, replacement: string) {
    return value => value.replace(pattern, replacement);
}

pipe('  this is a  long    string')
    .through(
        trim(),
        toUpperCase(),
        replace(/\s{2,}/, ' ')
    )

Generated Code

The library should allow for a dynamic amount of parameters. Unfortunately Typescript does not provide a way for parameters to reference their predecessors. To accommodate still a wide variety of use cases, the actual source code is generated, types for up to 20 functions.

If more than 20 functions are needed, another pipe can easily be started. For example:

pipe('  this is a  long    string')
    .through(
        trim(),
        toUpperCase(),
        pipe
    )
    .through(
        replace(/\s{2,}/, ' ')
    )

Generated Example Code

When generated for up to three functions looks like this:

export function pipe<T>(value: T): Pipe<T> {
    return new Pipe(value);
}

export class Pipe<T> {
    constructor(private value: T) {
    }

    through<R>(f: (v: T) => R): R
    through<R1, R2>(f0: (v0: T) => R1, f1: (v1: R1) => R2): R2;
    through<R1, R2, R3>(f0: (v0: T) => R1, f1: (v1: R1) => R2, f2: (v2: R2) => R3): R3;
    through<R>(fn1: (v: T) => unknown, ...fns: ((v: unknown) => unknown)[]): R {
        return fns.reduce(((previousValue, currentFunction) => currentFunction(previousValue)), fn1(this.value)) as R
    }
}