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

rura

v1.0.8

Published

🌊 A pipeline engine that flows like water.

Readme

A minimal pipeline engine for every modern workflow,
built for clarity and stability.

NPM version Bundle size Coverage Status TypeScript License

Features

  • Deterministic – Ordered hooks with effortless early exit.
  • Typed – Inferred context and output with zero boilerplate.
  • Universal – Tiny, framework-agnostic, and ready for any flow.

Installation

# npm
npm install rura
# yarn
yarn add rura
# pnpm
pnpm add rura

Quick Start

1. Define the initial context

const ctx = { count: 1 };
type Ctx = typeof ctx;

2. Create your hooks

  • Hooks can be created with rura.createHook, or defined manually using the RuraHook type.
  • Hooks may specify an order; omitted values default to 0.
import { rura, type RuraHook } from "rura";

// With createHook (recommended for convenience)
const addOne = rura.createHook<Ctx>("add-one", (ctx) => {
  ctx.count += 1;
}); // order: 0

// Manual hook definition (full control)
const stopIfEven: RuraHook<Ctx, number> = {
  name: "stop-if-even",
  run: (ctx) => {
    if (ctx.count % 2 === 0) {
      return { early: true, output: ctx.count };
    }
  },
  order: 2, // order: 2
};
  • Rura executes hooks in order and exits early when a hook returns { early: true, output }.

  • When the pipeline does not exit early, output is omitted and early becomes false.

3. Run the pipeline

const result = rura.run(ctx, [addOne, stopIfEven]);

console.log(result);
// -> {
//      early: true,
//      ctx: { count: 2 },
//      output: 2
//    }

Note: If your hooks are asynchronous,
use rura.createHookAsync() and run them through rura.runAsync() accordingly.


Pipeline Builder

If you prefer working with a reusable pipeline instance

rura.createPipeline() - Creates a lightweight, composable pipeline instance
that can register hooks, merge with other pipelines, and be inspected.

import { rura } from "rura";

const pipeline = rura.createPipeline<Context, Output>();

// Add hooks
pipeline
  .use(hookA) // chainable
  .use(hookB)
  .use(hookC);

example:

type Ctx = { value: number };

// Create a reusable pipeline instance
const pipelineA = rura.createPipeline<Ctx>();

// Register a hook using `use()`
pipelineA.use({
  name: "add-two",
  run: (ctx) => {
    ctx.value += 2;
  },
});

// Create another pipeline (preloaded with hooks)
const pipelineB = rura.createPipeline<Ctx>([
  {
    name: "multiply-three",
    run: (ctx) => {
      ctx.value *= 3;
    },
  },
]);

// Merge pipelines into a single combined pipeline
const pipeline = pipelineA.merge(pipelineB);

// Execute the pipeline
const result = await pipeline.run({ value: 1 });

console.log(result);
// -> {
//      early: false,
//      ctx: { value: 9 }
//    }

Note: If your pipeline includes async hooks,
be sure to use rura.createPipelineAsync(), which awaits each hook in order.

Pipeline Instance Methods

rura.createPipeline() β€” Synchronous Pipeline

| Method | Description | Parameters | Returns | | ---------------- | ----------------------------------------------------------------- | ---------- | ------------------ | | use(hook) | Adds a hook, normalizes its order, and re-sorts hooks. | hook | this (chainable) | | merge(other) | Merges hooks from another pipeline and re-sorts them. | other | this (chainable) | | getHooks() | Returns a sorted shallow copy of all registered hooks. | – | RuraHook[] | | debugHooks() | Prints a formatted, human-readable hook list. | – | void | | run(ctx) | Executes the pipeline synchronously. (delegates to rura.run()). | ctx | RuraResult |

rura.createPipelineAsync() β€” Asynchronous Pipeline

| Method | Description | Parameters | Returns | | ---------------- | ----------------------------------------------------------------------- | ---------- | --------------------- | | use(hook) | Adds a hook, normalizes its order, and re-sorts hooks. | hook | this (chainable) | | merge(other) | Merges hooks from another pipeline and re-sorts them. | other | this (chainable) | | getHooks() | Returns a sorted shallow copy of all registered hooks. | – | RuraHook[] | | debugHooks() | Prints a formatted, human-readable hook list. | – | void | | run(ctx) | Executes the pipeline asynchronously. (delegates to rura.runAsync()). | ctx | Promise<RuraResult> |