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

init-e2e

v0.1.0

Published

Scaffold a complete Playwright E2E test suite for any frontend project: project detection, HAR recording, mock factories, summary reporter, and code-driven outline.

Downloads

26

Readme

init-e2e

Scaffold a complete Playwright E2E test suite for any frontend project — project detection, HAR recording, mock factories, summary reporter, and code-driven test outline.

npm license

init-e2e is the engineering half of the e2e-generator toolkit. It handles the mechanical, deterministic work so an LLM (or a human) can focus on writing meaningful test cases.

The companion AI Skill lives at skill/ in the same monorepo.


Install

# Global (recommended for ad-hoc use)
npm install -g init-e2e

# One-off via npm init
npm init e2e -- -d /path/to/project --record --url "..."

Requires Node.js >= 18.


Quick start

# Recommended: record real APIs into a HAR, then scaffold everything
init-e2e init -d /path/to/your-app \
  --record \
  --url "http://dev.example.com/app?token=xxx" \
  --sanitize

# Already have a HAR (from Chrome DevTools / Charles / Fiddler)
init-e2e init -d /path/to/your-app \
  --from-har e2e/fixtures/recording.har \
  --sanitize

# Skip recording (mocks will use TODO placeholders — accuracy not guaranteed)
init-e2e init -d /path/to/your-app -y

# Generate the code-driven test outline (run before writing test cases)
init-e2e outline -d /path/to/your-app

Commands

| Command | Purpose | |---------|---------| | init-e2e init | One-shot: detect project → record/import HAR → emit playwright config, mock factories, summary reporter, spec skeletons | | init-e2e record | Only record a HAR via Playwright (interactive Chromium session) | | init-e2e generate-mocks | Re-generate mock factories from an existing HAR | | init-e2e outline | Static-analyse routes + components and produce e2e/code-outline.{md,json} (mind-map style) for use as a test-case checklist |

Run init-e2e <command> --help for full flag details.


What gets generated

your-app/
├── playwright.config.ts                # baseURL, devices (Pixel 5 by default), webServer, html + summary reporter
├── e2e/
│   ├── helpers/
│   │   ├── mock-data.ts                # appUrl(), mockAPIError(), createFactory(), bizOk()
│   │   └── mocks/                      # one file per real endpoint, generated from HAR
│   │       ├── index.ts                # setupAllMocks(page, overrides)
│   │       ├── api-inventory.json      # discovered endpoints + envelope info
│   │       └── <module>.ts
│   ├── reporters/
│   │   └── summary-reporter.ts         # custom Playwright reporter with per-suite summary
│   ├── code-outline.md                 # human-readable code-driven outline
│   ├── code-outline.json               # machine-readable mind-map (compatible with case.json format)
│   └── *.spec.ts                       # one spec per route, four-scenario skeleton
└── package.json                        # test:e2e / test:e2e:ui / test:e2e:report scripts added

Mocks ship as factories — every test can selectively override fields:

test("activity not started shows guard toast", async ({ page }) => {
  await setupAllMocks(page, { tradeInInfo: MOCK_TRADE_IN_NOT_STARTED });
  await page.goto(appUrl("/tradeIn"));
  // ...
});

Design principles

  1. Real data first. Mocks must come from recorded HARs; placeholders are an explicit downgrade signalled to the user.
  2. Code-driven outline. Test cases are derived from static analysis of routes, UI text, interactive elements, API calls, conditional rendering and entry params — not from a hand-drawn mind map.
  3. Four-scenario template. Every spec is split into Display / Branches / Interactions / API states so granularity stays consistent.
  4. CLI does engineering, Skill does methodology. No business heuristics in the CLI; no shell scripts in the Skill.

Read the full methodology in skill/SKILL.md and skill/references/methodology.md.


Local development

git clone https://github.com/justb/e2e-generator
cd e2e-generator/cli
npm install
npm run build
npm link              # init-e2e globally points at this checkout
npm test              # node code-outline.test.js

License

MIT © weiyuanbj