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

@cbuff/eval-express

v0.2.0

Published

Type-safe eval builder with scorer pipelines and run planning

Readme

Eval Express

Type-safe eval builder with scorer pipelines, run planning, and optional score aggregation.

Installation

bun add @cbuff/eval-express

Usage

import { defineTask, planTask, runTask, saveRuns } from "@cbuff/eval-express";
import { ai } from "@example/ai";

type EvalParams = { model: string };
type RunFields = { cost: number };

const task = defineTask<EvalParams, string, string, {}, RunFields>({
  name: "Support Ticket Title",
  scorer: "string_fuzzy_match",
  task: async (_id, input, { model }, setRunFields) => {
    const { data, metadata } = await ai.generate({
      model,
      prompt: `Write a short title:\n${input}`,
    });
    setRunFields({ cost: metadata.totalCost });
    return data;
  },
  defaults: { model: "openai/gpt-5-nano" },
  evals: [
    {
      input: "We can't reset our password after the latest update.",
      expectedOutput: "Password reset broken after update",
    },
    {
      input: "The app crashes whenever I try to upload a photo.",
      expectedOutput: "App crashes on photo upload",
    },
    {
      input: "How do I change my account email address?",
      expectedOutput: "Change account email address",
    },
  ],
});

const plans = planTask(task);
const { runs } = await runTask(task, { runsPerEval: 3, maxConcurrency: 2 });
await saveRuns(runs, "./runs.json", { pretty: true });

Scoring

Scorers run as part of the task pipeline and always receive the full context:

type ScorerFn = (ctx, output, expected) => ScoreResult | Promise<ScoreResult>;

type ScoreResult = {
  score: number;
  pass?: boolean;
  label?: string;
  details?: Record<string, unknown>;
};

Built-in scorers are always available and can be overridden in scorers:

  • string_exact_match
  • string_fuzzy_match
  • object_exact_match
  • object_fuzzy_match

Scorer resolution order:

  1. evals[i].scorer
  2. task.scorer
  3. Skip scoring if no scorer is configured

Score helpers

Optional aggregation utilities live in a subpath:

import { summarizeScores } from "@cbuff/eval-express/score-helpers";

const summary = summarizeScores(runs);

API

defineTask()

Creates a type-safe task definition. Call with generics to lock EvalParams, TaskInput, and TaskOutput.

planTask(task)

Returns a flat list of validated task plans without running anything.

runTask(task, options)

Executes a task, scoring as part of the run pipeline and returning typed run records.

Run fields

Tasks receive setRunFields(fields) to attach run-level fields to the run record. If called multiple times, the last call wins.

saveRuns(runs, filePath, options?)

Writes run records to disk as JSON, with an optional serializer for non-JSON data.

License

MIT

Release process

This package uses Changesets to manage versions and changelogs.

  • Create a changeset with bun run changeset
  • Merge the release PR created by the GitHub Actions workflow
  • The release workflow publishes to npm on main