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

@erickmeikoki/workspace

v1.0.0

Published

[![npm version](https://badge.fury.io/js/ts-pipeline.svg)](https://badge.fury.io/js/ts-pipeline) [![Build Status](https://github.com/erickmeikoki/ts-pipeline/workflows/CI/badge.svg)](https://github.com/erickmeikoki/ts-pipeline/actions) [![codecov](https:/

Downloads

8

Readme

ts-pipeline

npm version Build Status codecov

A TypeScript utility that enables elegant method chaining using pipeline syntax. This library provides a clean, functional approach to data transformation inspired by the pipeline operator proposal in JavaScript.

Features

  • Type-safe pipeline transformations
  • Functional programming style
  • Extends native prototypes for convenience
  • Useful utilities for common transformations
  • Works with strings, numbers, arrays, and objects
  • Zero dependencies

Installation

npm install ts-pipeline
# or
yarn add ts-pipeline

Usage

Basic Pipeline

import { pipeline } from 'ts-pipeline';

const result = pipeline("hello")
  .pipe(s => s.trim())
  .pipe(s => s.toUpperCase())
  .pipe(s => s + "!")
  .valueOf(); // "HELLO!"

With Built-in Utility Functions

import { pipeline, trim, toUpperCase, append } from 'ts-pipeline';

const result = pipeline("  hello world  ")
  .pipe(trim)
  .pipe(toUpperCase)
  .pipe(append("!"))
  .valueOf(); // "HELLO WORLD!"

Using String Prototype Extension

import 'ts-pipeline'; // Import for side effects to extend prototypes

const result = "  method chaining is cool  "
  .pipe(trim)
  .pipe(toUpperCase)
  .pipe(s => s + "!!!")
  .valueOf(); // "METHOD CHAINING IS COOL!!!"

Using the Helper Function

import { _ } from 'ts-pipeline';

const result = _("typescript")
  .pipe(s => s.toUpperCase())
  .pipe(s => s + " is awesome!")
  .valueOf(); // "TYPESCRIPT is awesome!"

Working with Numbers

import { pipeline } from 'ts-pipeline';

const result = pipeline(5)
  .pipe(n => n * 2)
  .pipe(n => n + 10)
  .pipe(n => n ** 2)
  .valueOf(); // 400

Working with Arrays

import { pipeline, map, filter, reduce } from 'ts-pipeline';

const result = pipeline([1, 2, 3, 4, 5])
  .pipe(filter(n => n % 2 === 0))
  .pipe(map(n => n * 3))
  .pipe(reduce((sum, n) => sum + n, 0))
  .valueOf(); // 18

Available Utility Functions

| Function | Description | |----------|-------------| | toUpperCase | Converts a string to uppercase | | toLowerCase | Converts a string to lowercase | | trim | Removes whitespace from both ends of a string | | reverse | Reverses a string | | split(separator) | Splits a string by the given separator | | join(separator) | Joins an array with the given separator | | map(fn) | Maps an array using the provided function | | filter(predicate) | Filters an array using the provided predicate | | reduce(fn, initialValue) | Reduces an array using the provided function and initial value | | compose(...fns) | Composes multiple functions into a single function | | tap(label) | Logs the current value in the pipeline (useful for debugging) | | toString | Converts any value to a string | | toNumber | Converts a string to a number | | append(suffix) | Appends a string to the input | | prepend(prefix) | Prepends a string to the input |

API Reference

pipeline<T>(value: T): Pipeline<T>

Creates a pipeline with the given value.

pipeline<T, R>(value: T, fn: PipelineFunction<T, R>): Pipeline<R>

Creates a pipeline with the given value and applies the function.

_<T>(value: T): Pipeline<T>

Helper function to make using the pipeline more intuitive.

Pipeline<T> Interface

  • pipe<R>(fn: PipelineFunction<T, R>): Pipeline<R> - Apply a function to the current value
  • valueOf(): T - Get the current value from the Pipeline
  • toString(): string - Convert the pipeline to a string

License

MIT

ts-pipeline