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

executable-stories-init

v0.1.4

Published

Bootstrap executable-stories (Vitest + Playwright) into a TypeScript repo.

Readme

executable-stories-init

Bootstrap executable-stories (Vitest, Playwright, Jest, and/or Cypress) into a TypeScript repo from zero. Detects your framework, package manager and monorepo layout, installs the right adapter, writes config, drops a sample story, and patches package.json scripts.

Install and run

Run from your project root, no install required:

npx executable-stories-init@latest
pnpm dlx executable-stories-init
yarn dlx executable-stories-init

The wizard is interactive by default. Pass --yes (or --json) to run non-interactively.

What it does

For each selected target (repo root, or one or more workspace packages):

  1. Detects existing Vitest / Playwright installs, an existing config, and TypeScript.
  2. Installs framework adapter packages and executable-stories-formatters using your repo's package manager (pnpm, yarn, or npm).
    • When multiple frameworks are selected for a target, dependencies are merged into one install pass.
  3. Writes configs (vitest.config.ts, playwright.config.ts, jest.config.mjs, cypress.config.ts) pre-wired for reporting.
  4. Writes sample stories in framework-appropriate locations.
  5. Patches package.json scripts for selected frameworks.
  6. Optionally writes tsconfig.json when missing and --ts is passed.

Anything already present is left alone (or skipped with a reason). Use --force to overwrite differing files.

Flags

| Flag | Description | | ---- | ----------- | | --vitest | Set up Vitest. | | --playwright | Set up Playwright. | | --jest | Set up Jest. | | --cypress | Set up Cypress. | | --both | Set up both Vitest and Playwright. | | --all | Set up Vitest, Playwright, Jest, and Cypress. | | --target <pkg...> | Workspace package(s) to set up. Use root for the repo root. Repeatable. | | --ts / --no-ts | Write a minimal tsconfig.json if missing. | | -y, --yes | Non-interactive; accept defaults. | | --interactive | Force prompts even when piped. | | --dry-run | Print the plan; do not write or install. | | --force | Overwrite differing existing files. | | --json | Machine-readable output. Implies --yes. Requires at least one framework flag (--vitest, --playwright, --jest, --cypress, --both, or --all). |

--both and --all are additive with explicit framework flags. Example: --both --jest sets up Vitest, Playwright, and Jest.

Examples

Single-package repo, Vitest only:

npx executable-stories-init@latest --vitest --yes

Monorepo, Vitest in two packages and Playwright at the root:

npx executable-stories-init@latest --vitest --target packages/api --target packages/web
npx executable-stories-init@latest --playwright --target root

Preview without changes:

npx executable-stories-init@latest --both --dry-run

CI / scripting:

npx executable-stories-init@latest --both --target root --json

After it runs

cd <target>           # repeat per selected target
<pm> install          # if you ran with --dry-run, or just to be sure
<pm> run test         # Vitest stories
<pm> run test:e2e     # Playwright stories (if installed)

If you bootstrap multiple frameworks at once, script names are collision-safe:

  • Vitest + Jest: test:stories:vitest, test:stories:jest
  • Playwright + Cypress: test:e2e:playwright, test:e2e:cypress
  • Vitest + Jest sample files: src/example.vitest.story.test.ts, src/example.jest.story.test.ts

Open the generated report:

# macOS
open reports/executable-stories.html
# Linux
xdg-open reports/executable-stories.html
# Windows
start reports\executable-stories.html

Playwright also needs browsers on first use:

pnpm exec playwright install      # pnpm
npm exec playwright install       # npm
yarn playwright install           # yarn

Detection rules

  • Package manager is taken from packageManager in the root package.json, then pnpm-lock.yaml, then yarn.lock, falling back to npm.
  • Monorepo is detected from pnpm-workspace.yaml (packages: entries) or workspaces in package.json (array or { packages: [...] }).
  • Already set up? If the framework is already a dependency, install is skipped; if a vitest.config.* / playwright.config.* exists, the config write is skipped unless --force is passed.

Exit codes

| Code | Meaning | | ---- | ------- | | 0 | Success. | | 1 | Plan applied with failures (e.g. install failed). | | 2 | Invalid CLI usage (e.g. --json without a framework). | | 130 | Cancelled by user (prompt aborted or no targets selected). |