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

@blastoiseomg/playwright-doc

v1.1.1

Published

Playwright test file documentation generator

Readme

playwright-doc

A CLI tool that generates structured Markdown documentation from Playwright test files by parsing the AST.

Features

  • Parses test(), test.describe(), and test.step() calls from .spec.ts files
  • Supports all test modifiers: skip, only, fixme, fail, slow
  • Supports describe modifiers: parallel, serial, skip, only, fixme
  • Detects custom test identifiers (test.extend() / import { test as base })
  • Handles nested describes and nested steps
  • Outputs clean Markdown with heading hierarchy and line numbers
  • Supports YAML output for machine-readable consumption (--format yaml)
  • Gracefully reports per-file parse errors without aborting

Installation

# Install globally
npm install -g @blastoiseomg/playwright-doc

# Or run directly with npx
npx @blastoiseomg/playwright-doc generate "tests/**/*.spec.ts"

Usage

# Print documentation to stdout
playwright-doc generate "tests/**/*.spec.ts"

# Write to a file
playwright-doc generate "tests/**/*.spec.ts" -o docs/tests.md

# Output as YAML
playwright-doc generate "tests/**/*.spec.ts" --format yaml

# Short flag
playwright-doc generate "tests/**/*.spec.ts" -f yaml -o docs/tests.yaml

# Write one file per source file, preserving directory structure
playwright-doc generate "tests/**/*.spec.ts" --outdir docs/

# Per-file YAML output
playwright-doc generate "tests/**/*.spec.ts" -d docs/ -f yaml

# Use a custom working directory
playwright-doc generate "**/*.spec.ts" --cwd ./packages/app

Sample output

# Test Documentation

## tests/auth.spec.ts

> ### describe: Authentication
>
> - **test**: should log in `(line 8)`
>   - step: Fill username
>   - step: Fill password
>   - step: Click submit
>
> - **test**: should reject bad credentials `[fail]` `(line 20)`

YAML output (--format yaml)

tests/auth.spec.ts:
  Authentication:
    - name: should log in
      steps:
        - Fill username
        - Fill password
        - Click submit
    - name: should reject bad credentials
      modifier: fail

Supported patterns

| Pattern | Example | |---------|---------| | Basic test | test('name', async () => {}) | | Test modifiers | test.skip(...), test.only(...), test.fixme(...), test.fail(...), test.slow(...) | | Describe | test.describe('group', () => {}) | | Describe modifiers | test.describe.parallel(...), test.describe.serial(...) | | Steps | await test.step('name', async () => {}) | | Nested steps | Steps inside steps are rendered with indentation | | Custom test ID | import { test as base } + const test = base.extend({...}) |

How it works

  1. File discovery — Uses fast-glob to find files matching the given pattern
  2. AST parsing — Each file is parsed with the TypeScript compiler API to build a syntax tree
  3. Test extraction — Walks the AST to find test(), test.describe(), and test.step() calls, resolving custom identifiers via import/extend chains
  4. Output generation — Converts the extracted structure into Markdown or YAML

The tool is built with fp-ts for type-safe error handling using TaskEither and Either, ensuring parse failures in individual files don't abort the entire run.

Contributing

See CONTRIBUTING.md for development setup and guidelines.

License

MIT