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

@watershed-labs/screenshot

v0.0.1

Published

Screenshot capture, attachment, blur, and resize for Watershed test suites

Readme

@watershed-labs/screenshot

Screenshot capture, image processing, PII blur, and reporter attachment for the Watershed ecosystem.

Part of the Watershed testing ecosystem.


Overview

@watershed-labs/screenshot is the baseline image capability shared by every Watershed template that touches a browser or device. create-otter uses it for failure evidence. create-salamander uses it for mobile failure captures. create-egret uses it as the capture layer underneath @watershed-labs/visual.

This package captures and attaches. It knows nothing about baselines, diffs, or thresholds. If you find yourself adding comparison logic here, it belongs in @watershed-labs/visual instead.


Installation

npm install @watershed-labs/screenshot

Usage

import { Screenshot } from '@watershed-labs/screenshot';

const shot = new Screenshot(driver);

// Full-page capture — attached to reporter automatically
await shot.capture({ label: 'checkout-failure', fullPage: true });

// Viewport only
await shot.capture({ label: 'header-state', fullPage: false });

// Element-scoped capture
const element = await driver.findElement(By.css('[data-testid="error-banner"]'));
await shot.captureElement(element, { label: 'error-banner' });

// With PII blur — blurs matching elements before capture, restores after
await shot.capture({
    label: 'user-profile',
    fullPage: true,
    blur: ['[data-testid="email"]', '[data-testid="card-number"]']
});

// Format conversion
await shot.capture({ label: 'summary', format: 'webp', quality: 85 });

API

| Method | Description | | ---------------------------------- | --------------------------------------------------------------------------------------------------------- | | capture(options) | Full-page or viewport screenshot. Attaches to @watershed-labs/reporter with label, timestamp, and worker ID. | | captureElement(element, options) | Crops to the bounding box of a specific WebElement. | | blur(selectors) | Applies a CSS blur to matching elements before capture. Automatically reverses after capture. | | resize(width, height) | Resizes the output image. Useful for normalising across different display densities. | | convert(format, quality?) | Converts output to png, jpeg, or webp. |


Options

| Option | Type | Default | Description | | ---------- | ------------------------------------- | -------- | ------------------------------------------------ | | label | string | required | Filename label for the captured image | | fullPage | boolean | true | Capture full scrollable page or viewport only | | format | 'png' \| 'jpeg' \| 'webp' \| 'avif' | 'avif' | Output image format (AVIF ~40-60KB per 1280x720) | | quality | number | 90 | JPEG or WebP quality (1–100) | | blur | string[] | [] | CSS selectors of elements to blur before capture |


Dependencies

  • sharp (Apache 2.0) — image processing and format conversion

Parallel Safety

Safe. Each instance is scoped to a single driver session. Worker ID is stamped on every captured image filename automatically to prevent output file collisions across parallel workers.


Licence

MIT — part of the Watershed ecosystem.