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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@vibe-validate/extractors

v0.17.4

Published

LLM-optimized error extractors for validation output

Readme

@vibe-validate/extractors

LLM-optimized error extractors for validation output.

Features

  • Intelligent Error Extraction: Automatically detects tool type and applies appropriate extractor
  • Token-Efficient Output: Limits errors to first 10, removes noise, focuses on actionable info
  • Actionable Guidance: Provides tool-specific fixing suggestions
  • Zero Dependencies: Pure TypeScript implementation

Supported Extractors

Test Frameworks

  • Vitest: Dual format support (Format 1 & 2), assertion errors, test hierarchy
  • Jest: Comprehensive error extraction, all failure types supported
  • Mocha: Native Mocha output format, stack trace parsing
  • Jasmine: Angular ecosystem support, Message:/Stack: section parsing
  • TAP (Test Anything Protocol): Covers Tape, node-tap, YAML diagnostics parsing
  • Ava: Node.js community favorite, detailed block parsing with quality metadata
  • Playwright: Modern E2E testing, numbered failure blocks, stack trace extraction
  • JUnit XML: Universal test format for any framework with XML output

Code Quality Tools

  • TypeScript (tsc): Parses file(line,col): error TSxxxx: message format
  • ESLint: Parses file:line:col - severity message [rule] format
  • OpenAPI: Filters validation errors from specification validators

Fallback

  • Generic: Fallback for unknown tools (removes npm noise)

Installation

npm install @vibe-validate/extractors

Usage

Smart Extractor (Recommended)

Auto-detects tool type from step name:

import { extractByStepName } from '@vibe-validate/extractors';

const result = extractByStepName('TypeScript Type Checking', tscOutput);

console.log(result.summary);      // "3 type error(s), 0 warning(s)"
console.log(result.guidance);     // "Type mismatch - check variable/parameter types"
console.log(result.cleanOutput);  // Clean, formatted error list
console.log(result.errors);       // Structured error array

Direct Extractor Usage

Use direct extractors when:

  • You know the exact tool being used
  • You want explicit control over extraction
  • You need tool-specific options

Example: Using Jest extractor directly

import { extractJestErrors } from '@vibe-validate/extractors';
import { execSync } from 'child_process';

const jestOutput = execSync('npx jest --no-coverage').toString();
const result = extractJestErrors(jestOutput);

console.log(`Found ${result.errors.length} test failures`);
console.log(`Quality: ${result.metadata?.confidence}% confidence`);
result.errors.forEach(error => {
  console.log(`  ${error.file}:${error.line} - ${error.message}`);
});

All available extractors:

import {
  // Test framework extractors
  extractVitestErrors,
  extractJestErrors,
  extractMochaErrors,
  extractJasmineErrors,
  extractTAPErrors,
  extractAvaErrors,
  extractPlaywrightErrors,
  extractJUnitErrors,

  // Code quality extractors
  extractTypeScriptErrors,
  extractESLintErrors,
  extractOpenAPIErrors,

  // Fallback
  extractGenericErrors
} from '@vibe-validate/extractors';

Utilities

import { stripAnsiCodes, extractErrorLines } from '@vibe-validate/extractors';

const clean = stripAnsiCodes(colorfulOutput);
const errorLines = extractErrorLines(verboseOutput);

API

extractByStepName(stepName: string, output: string): ErrorExtractorResult

Smart extractor with auto-detection.

Detection rules:

  • TypeScript: Step name contains "TypeScript" or "typecheck"
  • ESLint: Step name contains "ESLint" or "lint"
  • Vitest: Output contains marker or FAIL keyword
  • Jest: Output contains FAIL or bullet pattern
  • Mocha: Output contains Mocha's passing/failing summary format
  • Jasmine: Output contains "Failures:" header
  • TAP: Output contains "TAP version" or "not ok" format
  • Ava: Output contains ✘ [fail]: pattern
  • Playwright: Output contains with .spec.ts references
  • JUnit XML: Output starts with <?xml and contains <testsuite>
  • OpenAPI: Step name contains "OpenAPI"
  • Generic: Fallback for unknown types

Type Definitions

interface FormattedError {
  file?: string;
  line?: number;
  column?: number;
  message: string;
  code?: string;
  severity?: 'error' | 'warning';
  context?: string;
  guidance?: string;
}

interface ExtractionMetadata {
  confidence: number;              // 0-100: Based on pattern match quality
  completeness: number;            // % of failures with file + line + message
  issues: string[];                // Problems encountered during extraction
  suggestions?: string[];          // For developerFeedback mode only
}

interface ErrorExtractorResult {
  errors: FormattedError[];        // First 10 errors (structured)
  summary: string;                 // Human-readable summary
  totalCount: number;              // Total error count
  guidance?: string;               // Actionable fixing guidance
  cleanOutput: string;             // Clean formatted output for YAML/JSON
  metadata?: ExtractionMetadata;   // Extraction quality metadata
}

Why LLM-Optimized?

  1. Token Efficiency: Limits output to first 10 errors (most relevant)
  2. Noise Removal: Strips ANSI codes, npm headers, stack traces
  3. Structured Data: Provides parseable error objects with file:line:col
  4. Actionable Guidance: Suggests specific fixes based on error codes
  5. Clean Embedding: cleanOutput ready for YAML/JSON state files

Design Philosophy

Agent-First: Designed for consumption by AI assistants (Claude Code, Cursor, etc.), not just humans.

Deterministic: Same input always produces same output (no timestamps, no randomness).

Minimal: Zero runtime dependencies, pure TypeScript.

License

MIT