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

@bernierllc/validators-runner

v0.5.0

Published

Execution engine for the BernierLLC validators ecosystem - coordinates validation workflows, manages rules, and orchestrates reporting

Readme

@bernierllc/validators-runner

Validation orchestration engine that provides a flexible framework for running validation rules against targets with advanced configuration, reporting, and error handling capabilities.

Installation

npm install @bernierllc/validators-runner

Usage

Basic Example

import { ValidationRunner, RunnerBuilder } from '@bernierllc/validators-runner';

// Create a validation rule
const textRule = {
  meta: { id: 'text-check', name: 'Text Check' },
  async execute(target) {
    if (target.data.includes('error')) {
      return [{ 
        level: 'error', 
        message: 'Found error in text',
        location: { line: 1, column: 0 }
      }];
    }
    return [];
  }
};

// Build and configure runner
const runner = new RunnerBuilder()
  .withRule(textRule)
  .withConcurrency(5)
  .build();

// Define targets to validate
const targets = [
  { id: 'doc1', type: 'text', data: 'This is clean content' },
  { id: 'doc2', type: 'text', data: 'This has error content' }
];

// Run validation
const result = await runner.validate(targets);

console.log(`Found ${result.problems.length} problems`);
console.log(`Processed ${result.stats.targets} targets in ${result.stats.durationMs}ms`);

Advanced Configuration

import { ConfigLoader } from '@bernierllc/validators-runner';

// Load configuration from file
const config = await ConfigLoader.fromFile('./validation.config.json');

const runner = new RunnerBuilder()
  .withConfig(config)
  .withRule(textRule)
  .withReporter(consoleReporter)
  .build();

// Configure filtering and rule options
const configuredRunner = new ValidationRunner({
  rules: [textRule],
  config: {
    include: ['**/*.ts', '**/*.js'],
    exclude: ['**/node_modules/**'],
    primitives: {
      'text-check': ['error', { maxLength: 100 }]
    }
  },
  concurrency: 10,
  timeout: 5000
});

Configuration File Example

{
  "include": ["**/*.ts", "**/*.js"],
  "exclude": ["**/dist/**", "**/node_modules/**"],
  "primitives": {
    "text-check": "error",
    "length-check": ["warn", { "max": 1000 }]
  },
  "timeout": 10000
}

API Reference

ValidationRunner

Main orchestration class for running validations.

Constructor

new ValidationRunner(options: RunnerOptions)

Options:

  • rules: Rule[] - Validation rules to apply
  • config?: RunnerConfig - Configuration options
  • concurrency?: number - Max concurrent validations (default: 5)
  • timeout?: number - Timeout per validation in ms (default: 30000)

Methods

validate(targets: RunnerTarget[]): Promise<RunnerResult>

Validates all targets and returns comprehensive results.

Parameters:

  • targets - Array of targets to validate

Returns:

  • RunnerResult - Validation results with problems, stats, and metadata

RunnerBuilder

Fluent API for constructing ValidationRunner instances.

Methods

withRule(rule: Rule): RunnerBuilder
withReporter(reporter: Reporter): RunnerBuilder  
withConfig(config: RunnerConfig): RunnerBuilder
withConcurrency(concurrency: number): RunnerBuilder
withTimeout(timeout: number): RunnerBuilder
build(): ValidationRunner

ConfigLoader

Utility for loading configuration from various sources.

Static Methods

ConfigLoader.fromFile(path: string): Promise<RunnerConfig>
ConfigLoader.fromObject(obj: any): Promise<RunnerConfig>
ConfigLoader.fromEnv(prefix?: string): Promise<RunnerConfig>

Types

RunnerTarget

interface RunnerTarget {
  id: string;
  type: string;
  data: any;
}

RunnerResult

interface RunnerResult {
  problems: Problem[];
  stats: {
    targets: number;
    durationMs: number;
    rulesApplied: string[];
  };
  targetResults: Map<string, ValidationResult>;
  executionMeta: ExecutionMetadata;
}

RunnerConfig

interface RunnerConfig {
  include?: string[];
  exclude?: string[];
  primitives?: Record<string, any>;
  timeout?: number;
}

Integration Status

Logger Integration

  • Status: not-applicable
  • Reason: Core validation infrastructure focuses on orchestration without introducing logging dependencies. Consumer applications should handle logging of validation results as appropriate for their context.

Docs-Suite Integration

  • Status: ready
  • Format: markdown
  • Description: Package includes comprehensive markdown documentation with TypeScript examples and API references suitable for docs-suite integration.

NeverHub Integration

  • Status: not-applicable
  • Reason: Validation runner is a foundational utility that operates synchronously on provided data. Event-driven service discovery is not applicable to this validation orchestration pattern.

Error Handling

The package follows structured error handling patterns:

// All operations return structured results
const result = await runner.validate(targets);

if (result.problems.length > 0) {
  console.log('Validation issues found:');
  result.problems.forEach(problem => {
    console.log(`${problem.level}: ${problem.message}`);
  });
}

// Execution metadata includes error details
if (result.executionMeta.errors.length > 0) {
  console.log('Execution errors:', result.executionMeta.errors);
}

Contributing

This package follows the BernierLLC package standards:

  • TypeScript strict mode
  • 90%+ test coverage for core packages
  • Zero linting errors
  • Comprehensive documentation

License

Copyright (c) 2025 Bernier LLC. All rights reserved.