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

stryker-mutator-bun-runner

v0.4.0

Published

A test runner plugin to use Bun with StrykerJS, the JavaScript mutation testing framework

Readme

stryker-mutator-bun-runner

npm version CI License: Apache-2.0 Mutation testing badge

A test runner plugin to use Bun with StrykerJS, the JavaScript mutation testing framework.

Lightning-fast mutation testing - Leverage Bun's speed for rapid mutation testing

🔥 Zero Config TypeScript - Works with TypeScript and JSX out of the box

📊 Smart Coverage Analysis - Only run tests that can detect mutations

🎯 100% Tested - Comprehensive test suite with 100% mutation score

Features

✅ Implemented

  • Fast Test Execution - Leverage Bun's speed for quick test runs
  • TypeScript & JSX Support - No configuration needed
  • Coverage Analysis - Smart test filtering with perTest coverage
  • Process Pool - Reuse Bun processes for 2-3x faster execution
  • Watch Mode - Real-time mutation testing during development
  • Snapshot Testing - Full support for Bun's snapshot features
  • Source Maps - Accurate error reporting with source map support
  • Flexible Configuration - Extensive options for customization
  • Timeout Handling - Configurable timeouts with graceful handling
  • Test Filtering - Run only tests that can kill specific mutants
  • Environment Variables - Full control over test environment
  • Custom Commands - Support for custom test scripts
  • TypeScript Strict Mode - Full support for strict TypeScript projects
  • 100% Test Coverage - Thoroughly tested with 251 tests
  • ESLint Clean - Zero errors, zero warnings

🚀 Performance

  • 2-3x Faster with process pool enabled
  • 90% Less Test Runs with perTest coverage analysis
  • Optimized for CI/CD with configurable worker counts

Installation

npm install --save-dev @stryker-mutator/core stryker-mutator-bun-runner

Quick Start

1. Initialize StrykerJS (if new project)

npx stryker init

Choose "bun" as your test runner when prompted.

2. Or manually create stryker.config.json

{
  "$schema": "./node_modules/@stryker-mutator/core/schema/stryker-schema.json",
  "packageManager": "npm",
  "testRunner": "bun",
  "plugins": ["stryker-mutator-bun-runner"],
  "mutate": ["src/**/*.ts", "!src/**/*.test.ts"],
  "coverageAnalysis": "perTest",
  "reporters": ["html", "clear-text", "progress"],
  "bun": {
    "testFiles": ["**/*.test.ts"],
    "timeout": 30000
  }
}

3. Run mutation testing

npx stryker run

4. View results

Open reports/mutation/mutation.html in your browser to see detailed results.

Configuration

Basic Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | testFiles | string[] | ["**/*.test.{js,ts,jsx,tsx}", "**/*.spec.{js,ts,jsx,tsx}"] | Test file patterns | | timeout | number | 10000 | Timeout per test in milliseconds | | bail | boolean | false | Stop on first test failure | | nodeArgs | string[] | [] | Additional Bun process arguments | | env | object | {} | Environment variables | | command | string | undefined | Custom test command | | processPool | boolean | true | Enable process pooling for performance | | maxWorkers | number | 4 | Maximum number of worker processes | | watchMode | boolean | false | Enable watch mode for continuous testing | | updateSnapshots | boolean | false | Update snapshots during test runs |

Example Configurations

TypeScript Project

{
  "testRunner": "bun",
  "plugins": ["stryker-mutator-bun-runner"],
  "mutate": ["src/**/*.ts", "!src/**/*.test.ts"],
  "coverageAnalysis": "perTest",
  "bun": {
    "testFiles": ["src/**/*.test.ts"],
    "timeout": 30000
  }
}

Custom Test Command

{
  "bun": {
    "command": "bun test:unit --coverage"
  }
}

CI Environment

{
  "bun": {
    "timeout": 60000,
    "nodeArgs": ["--max-old-space-size=4096"],
    "env": {
      "CI": "true",
      "NODE_ENV": "test"
    }
  }
}

Performance Optimized with Process Pool

{
  "bun": {
    "processPool": true,
    "maxWorkers": 8,
    "testFiles": ["**/*.test.ts"],
    "coverageAnalysis": "perTest"
  }
}

Watch Mode for Development

{
  "bun": {
    "watchMode": true,
    "processPool": true,
    "maxWorkers": 2
  }
}

Snapshot Testing

{
  "bun": {
    "updateSnapshots": false,  // Set to true to update snapshots
    "testFiles": ["**/*.snapshot.test.ts"]
  }
}

Requirements

  • Bun >= 1.0.0
  • StrykerJS >= 9.0.0
  • Node.js >= 20.0.0 (for StrykerJS)

Documentation

Performance Tips

1. Enable Coverage Analysis

{
  "coverageAnalysis": "perTest"
}

This can reduce test execution time by 80-90% by only running relevant tests for each mutant.

2. Use Specific File Patterns

{
  "mutate": ["src/**/*.ts", "!src/**/*.test.ts", "!src/**/*.d.ts"]
}

3. Parallelize in CI

{
  "concurrency": 4,
  "concurrency_comment": "Adjust based on your CI runner"
}

Troubleshooting

Common Issues

Bun not found

curl -fsSL https://bun.sh/install | bash

Out of memory

{
  "bun": {
    "nodeArgs": ["--max-old-space-size=8192"]
  }
}

Timeout errors

{
  "bun": {
    "timeout": 60000
  }
}

See the troubleshooting guide for more solutions.

Project Status

This plugin is actively maintained and tested with:

  • ✅ 100% line coverage
  • ✅ 97.43% function coverage
  • ✅ 100% mutation score
  • ✅ Comprehensive test suite (251 tests)
  • ✅ ESLint clean (0 errors, 0 warnings)
  • ✅ TypeScript strict mode
  • ✅ Phase 3 Complete: Process Pool, Watch Mode, Snapshot Testing, Source Maps

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development

# Clone the repo
git clone https://github.com/stryker-mutator/stryker-bun.git
cd stryker-bun

# Install dependencies
npm install

# Run tests
npm test

# Run linting
npm run lint

# Build the project
npm run build

Support

Changelog

See CHANGELOG.md for a detailed list of changes in each release.

License

Apache License 2.0