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

@michalfidor/playswag

v1.9.0

Published

Playwright API coverage tracking against Swagger/OpenAPI specifications

Readme

Playswag

playswag logo

Playwright API coverage tracking against Swagger / OpenAPI specifications.

playswag transparently wraps Playwright's built-in request fixture to record every API call made during your tests, then compares the results against your OpenAPI spec(s) to report coverage across five dimensions:

| Dimension | What it measures | |-----------|------------------| | Endpoints | Which path + method combinations were called | | Status codes | Which response codes defined in the spec were exercised | | Parameters | Which query/path/header params were supplied | | Body properties | Which request body fields were provided | | Response properties | Which response body fields were observed |

Works with multiple workers out of the box — per-worker data is collected via test attachments and aggregated in the reporter process.


Installation

npm install --save-dev @michalfidor/playswag

@playwright/test >=1.20.0 is a required peer dependency.


Quick start

1. Replace your import

-import { test, expect } from '@playwright/test';
+import { test, expect } from '@michalfidor/playswag';

That's it. The request fixture is transparently wrapped — existing tests need no other changes.

2. Add the reporter to playwright.config.ts

import { defineConfig } from '@michalfidor/playswag';

export default defineConfig({
  reporter: [
    ['list'],
    ['@michalfidor/playswag/reporter', {
      specs: ['./openapi.yaml'],
      outputDir: './playswag-coverage',
      outputFormats: ['console', 'json'],
      threshold: { endpoints: 80, statusCodes: 60 },
    }],
  ],
  use: {
    baseURL: 'https://api.example.com',
  },
});

3. Run your tests

npx playwright test

Coverage is printed to the terminal and written to ./playswag-coverage/playswag-coverage.json.


Documentation

| Guide | Description | |-------|-------------| | Configuration | Full config reference — all reporter options, thresholds, console/JSON/HTML/badge/JUnit/markdown settings | | Output formats | Console, HTML, JSON, SVG badge, JUnit XML, and Markdown output details | | Multi-project setup | Per-project specs, per-file opt-out, custom request contexts, multiple spec files | | CI integration | GitHub Actions auto-detection, merging reports from parallel jobs (project-based, sharded, mixed), best practices | | Coverage history | Sparkline trends, delta indicators, persisting history across CI runs | | API reference | All public exports — fixtures, functions, config types, result types |


How it works

Worker process                     Main process (Reporter)
──────────────────                 ──────────────────────
request.get('/api/users')
  ↓ Proxy intercepts
  records { method, url,
    status, body, params }
  ↓
testInfo.attach(                   onTestEnd():
  'playswag:hits', JSON             reads attachment
)                                   appends to aggregated list
                                   ↓
                                   onEnd():
                                     parse OpenAPI spec(s)
                                     match hits → path templates
                                     calculate 5-dimension coverage
                                     print console report
                                     write output files

Data flows from each worker to the reporter via Playwright's built-in test attachment IPC — no temp files, no shared state, no locking required. Works correctly with any number of parallel workers.


License

MIT