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

@aaaaorg/flakefence

v0.1.0

Published

Detect and rank flaky tests from JUnit XML reports

Readme

FlakeFence 🛡️

Detect and rank flaky tests from JUnit XML reports. Point it at your CI test results and instantly see which tests are unreliable.

Install

npm install -g @aaaaorg/flakefence

Or use with npx:

npx @aaaaorg/flakefence ./test-results/

Usage

# Analyze JUnit XML files in a directory (recursive)
flakefence ./test-results/

# JSON output of top 10 flakiest
flakefence ./test-results/ -f json -t 10

# Markdown report
flakefence ./test-results/ -f markdown

# CI mode — exit code 1 if flaky tests found
flakefence ./test-results/ --ci --threshold 0.5

# Generate quarantine list (test names only)
flakefence ./test-results/ --quarantine

Options

| Flag | Description | Default | |------|-------------|---------| | -f, --format <fmt> | Output format: table, json, markdown | table | | -t, --top <n> | Show top N flakiest tests | 20 | | --threshold <n> | Min flakiness score (0–1) | 0.1 | | --quarantine | Output just test names (for CI skip lists) | off | | --ci | Exit with code 1 if flaky tests found | off | | -h, --help | Show help | |

How It Works

  1. Scans a directory for JUnit XML files (the standard CI test report format)
  2. Parses all test results across multiple runs
  3. Groups tests by name and classname
  4. Identifies flaky tests — those that both pass AND fail across runs
  5. Ranks by flakiness score (failure rate weighted by frequency)

A test that passes 7/10 times and fails 3/10 times is flaky. A test that always passes or always fails is not.

Flakiness Score

failRate = (failures + errors) / totalRuns
flakiness = 1 - |failRate - 0.5| × 2

Score ranges from 0 (always passes or always fails) to 1 (50/50 pass/fail — maximally flaky).

CI Integration

Add to your pipeline to catch flaky tests before they erode trust:

# GitHub Actions example
- name: Check for flaky tests
  run: npx @aaaaorg/flakefence ./test-results/ --ci --threshold 0.3

Supported Formats

  • JUnit XML — the standard format produced by most test runners (Jest, pytest, JUnit, Go, etc.)
  • Handles <testsuites> wrappers, nested suites, skipped tests, and error cases

License

MIT © aaaaorg