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

@flakeytesting/cypress-snapshots

v0.9.0

Published

Cypress plugin that captures DOM snapshots at each command step for Flakey

Readme

@flakeytesting/cypress-snapshots

Cypress plugin that captures DOM snapshots at each command step so you can replay a failing test in the Flakey dashboard without re-running it. Each snapshot bundle records the serialised DOM, viewport size, scroll position, and per-step metadata — rendered as a step-by-step scrubber in the dashboard.

Install

pnpm add -D @flakeytesting/cypress-snapshots
# or
npm install --save-dev @flakeytesting/cypress-snapshots

cypress is a required peer (>=12.0.0). @badeball/cypress-cucumber-preprocessor is optional — only needed for the ./cucumber subpath.

Quick start

Two changes:

// cypress.config.ts
import { defineConfig } from "cypress";
import { flakeySnapshots } from "@flakeytesting/cypress-snapshots/plugin";

export default defineConfig({
  e2e: {
    setupNodeEvents(on, config) {
      flakeySnapshots(on, config);
      return config;
    },
  },
});
// cypress/support/e2e.ts
import "@flakeytesting/cypress-snapshots/support";

If you also use @flakeytesting/cypress-reporter, calling setupFlakey(on, config) wires snapshots automatically — you don't need to call flakeySnapshots separately.

Cucumber projects

If you use @badeball/cypress-cucumber-preprocessor, additionally import the cucumber subpath from a step-definition file (NOT from support/e2e.ts):

// cypress/e2e/_flakey-cucumber-hooks.ts
import "@flakeytesting/cypress-snapshots/cucumber";

This registers a BeforeStep hook that pushes Gherkin step markers into the snapshot bundle. Importing it from the support file breaks because the preprocessor's per-feature registry isn't available in the support context.

Options

flakeySnapshots(on, config, options?) accepts:

| Option | Type | Default | Notes | |---|---|---|---| | outputDir | string | "cypress/snapshots" | Where snapshot bundles are written | | enabled | boolean | true | Set false to disable capture entirely | | maxHtmlBytes | number | 2 * 1024 * 1024 (2 MB) | Per-step HTML size cap — oversized DOMs (PDF iframes, etc.) are replaced with a placeholder + console.warn | | maxBundleBytes | number | 64 * 1024 * 1024 (64 MB) | Aggregate cap across all steps in one test — oldest steps evicted FIFO when exceeded |

The enabled, maxHtmlBytes, and maxBundleBytes options are also exposed to the browser via Cypress.env("FLAKEY_SNAPSHOTS_*") so the support file picks them up automatically. outputDir is Node-side only (it never reaches the browser).

Live streaming

When FLAKEY_API_URL, FLAKEY_API_KEY, and FLAKEY_LIVE_RUN_ID are all set in the process environment, snapshot bundles stream to POST /live/:runId/snapshot immediately after they're written to disk. On a successful upload the local file is unlinkSynced. On failure (or when no live run is active) the file stays on disk and gets picked up by the end-of-run batch uploader instead.

@flakeytesting/cypress-reporter's setupFlakey populates the env vars automatically via @flakeytesting/live-reporter.

Compatibility

  • Cypress: >=12.0.0 (required peer)
  • @badeball/cypress-cucumber-preprocessor: >=20.0.0 (optional peer)
  • Node: 20+

Links