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

@codehz/pipeline

v0.4.4

Published

A compact, strongly-typed, builder-style pipeline utility for TypeScript. It lets you build a sequence of transformation "passes" that merge fields into a shared environment object. The builder is smart about synchronous vs asynchronous passes — if any pa

Downloads

682

Readme

pipeline — tiny TypeScript pipeline builder

A compact, strongly-typed, builder-style pipeline utility for TypeScript. It lets you build a sequence of transformation "passes" that merge fields into a shared environment object. The builder is smart about synchronous vs asynchronous passes — if any pass returns a Promise/thenable at runtime, the final pipeline switches to async behavior.

⚡️ Small, zero-deps, TypeScript-first utility designed for composable transforms.


Features

  • Statically typed pipeline builder with incremental environment merging
  • Supports synchronous and asynchronous passes (switches to Promise at runtime)
  • Accepts both functions and objects implementing run(env) as passes
  • Tiny, well-documented, and easy to drop into TypeScript projects

Quick example

import { pipeline } from "@codehz/pipeline"; // or relative import

const fn = pipeline<{ input: number }>()
	.addPass((env) => ({ output: env.input + 1 }))
	.addPass((env) => ({ log: `${env.input} => ${env.output}` }))
	.build();

const res = fn({ input: 1 });

// res has inferred type: { input: number; output: number; log: string }
console.log(res);

This will run synchronously and print a merged environment object.

If a pass returns a Promise/thenable at runtime, the returned value from the built pipeline will be a Promise that resolves to the final environment.


API overview

  • pipeline<Input>() — factory that returns a PipelineBuilder instance.
  • PipelineBuilder.addPass(fn | { run(env) }) — append a pass. The values returned from the pass are merged into the pipeline's environment and are available to subsequent passes.
  • PipelineBuilder.build() — finalize and retrieve the runner function. The runtime result will be synchronous or Promise-based depending on the passes.

Installation

This repository uses Bun for tests in the included package.json. You can use Bun or any package manager you prefer for installation and running tests.

Using Bun (recommended for local dev here):

bun install

If you prefer npm / yarn:

npm install
# or
yarn install

Note: TypeScript is a peer dependency (this project targets TypeScript v5+).


Running tests

The repository's tests use Bun’s test runner. Run the tests with:

bun test

If you don't have Bun installed you can still run tests with a different test runner — the codebase uses plain TypeScript/JS and the tests are simple and self-contained.


Contributing

Contributions are welcome — open an issue or PR for improvements, additional helpers, or new features. Keep changes small and add tests for new behavior.


License

This project is licensed under the terms in the repository (see LICENSE).