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

@idriszade/eval-scorers

v0.1.7

Published

Pipeline-kit eval scorers — exactMatch, numericClose, jsonShape, llmJudge

Readme

@idriszade/eval-scorers

Built-in scorers for @idriszade/eval. Each scorer is a factory returning a Scorer<I, O> — the same type accepted by defineEval({ scorers }). Provided: exactMatch, numericClose, jsonShape, llmJudge.

Installation

pnpm add @idriszade/eval-scorers

exactMatch

Recursive structural deep-equal. Handles Date, Map, Set, NaN, null, undefined, nested objects, and arrays.

import { exactMatch } from '@idriszade/eval-scorers';

const scorer = exactMatch<string, string>();

scorer({ input: 'q', output: 'foo', expected: 'foo' });
// { pass: true, score: 1 }

scorer({ input: 'q', output: 'foo', expected: 'bar' });
// { pass: false, score: 0 }

numericClose

Passes when Math.abs(output - expected) <= tolerance.

import { numericClose } from '@idriszade/eval-scorers';

const scorer = numericClose({ tolerance: 0.01 });

scorer({ input: '', output: 3.14159, expected: Math.PI });
// { pass: true, score: 1 }

scorer({ input: '', output: 3.0, expected: Math.PI });
// { pass: false, score: 0, reason: 'abs diff 0.1416 > tolerance 0.01' }

tolerance defaults to 0 (exact equality).

jsonShape

Validates output against a Zod schema via safeParse. Pass if parsing succeeds; fail with the formatted Zod error as reason.

import { jsonShape } from '@idriszade/eval-scorers';
import { z } from 'zod';

const scorer = jsonShape({
  zodSchema: z.object({ title: z.string(), tags: z.array(z.string()) }),
});

scorer({ input: '', output: { title: 'hello', tags: ['a'] } });
// { pass: true, score: 1 }

scorer({ input: '', output: { title: 42 } });
// { pass: false, score: 0, reason: 'Expected string, received number at title; ...' }

llmJudge

LLM-as-judge. Calls a ModelClient you supply — no SDK is bundled. Returns Score from the model's verdict.

import { llmJudge } from '@idriszade/eval-scorers';
import type { ModelClient } from '@idriszade/eval-scorers';

// Implement ModelClient against any SDK.
const myClient: ModelClient = {
  async judge({ model, system, user }) {
    const response = await openai.chat.completions.create({
      model,
      messages: [
        { role: 'system', content: system ?? '' },
        { role: 'user', content: user },
      ],
    });
    return JSON.parse(response.choices[0]?.message.content ?? '{}');
  },
};

const scorer = llmJudge({
  model: 'gpt-4o',
  rubric: 'Score 1.0 if the summary is factually accurate, 0.0 otherwise.',
  client: myClient,
});

// Use in defineEval:
defineEval({
  scorers: { judge: scorer },
  // ...
});

rubric defaults to a strict correct/incorrect prompt when omitted.

LLM-as-judge is not a special type

llmJudge returns a plain Scorer<I, O> — the same type as exactMatch or numericClose. It calls a model internally, but from the runner's perspective it is just a function that returns a Score. There is no special eval-framework protocol. This mirrors the Braintrust/autoevals 2025–26 pattern of per-SDK scorer libraries rather than a built-in judge primitive.

// llmJudge and exactMatch are interchangeable at the call site.
defineEval({
  scorers: {
    shape: jsonShape({ zodSchema: mySchema }),
    correctness: llmJudge({ model: 'gpt-4o', client: myClient }),
  },
});

License — MIT