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/hooks

v0.1.0

Published

Cucumber hook library with enforced execution order

Readme

@watershed-labs/hooks

Side-effect hook registration for the Watershed ecosystem.

Part of the Watershed testing ecosystem.

Usage

// support/hooks.js — one import registers all hooks
import '@watershed-labs/hooks';

// Add template-specific hooks after the import
import { Before } from '@cucumber/cucumber';

Before({ tags: '@login' }, async function () {
    await this.page.login(this.config.get('testUser'));
});

What it does

The package registers six hooks when imported:

  1. Before — stores the pickle reference (this._pickle); detects @SharedDriver tag and reuses a cached browser driver across scenarios in the same feature file
  2. BeforeStep — logs each step's text at debug level
  3. AfterStep — attaches per-step log chunks to the Cucumber report when logging.perStep is enabled
  4. After — flushes buffered logs when logging.buffered is enabled; runs an @Accessibility WCAG scan when the tag is present and this.a11y is available; manages @SharedDriver driver lifecycle (cache on first use, quit when refcount reaches zero); then calls this.teardown()

It also sets a default Cucumber timeout of 60 seconds.

@SharedDriver

Scenarios tagged @SharedDriver within the same feature file reuse a single browser driver. The driver is cached after the first scenario and automatically quit when the last referencing scenario completes.

@SharedDriver
Scenario: Login
  Given I am on the login page

@SharedDriver
Scenario: Dashboard
  Given I am on the dashboard  # reuses driver from Login scenario

Drivers are keyed by feature file URI and managed per-worker, making them safe in parallel execution.

@Accessibility

Scenarios tagged @Accessibility trigger an automated WCAG scan via this.a11y.scan() after the scenario completes. Critical and serious violations are attached as JSON to the report. If violations are found and the scenario has not already failed, the scenario is marked as failed.

@Accessibility
Scenario: Homepage is accessible
  Given I open the homepage

Requires this.a11y (an A11yScanner instance) on the World. Templates that provide it (e.g., create-otter) get this automatically.

Exports

| Export | Purpose | | ----------------------- | --------------------------------------------- | | _resetSharedDrivers() | Clears the shared driver cache (testing only) |

What it does NOT do

  • Validate environment configuration
  • Provision shared resources
  • Capture screenshots on failure
  • Generate reports or merge worker output

Those responsibilities belong to each template's support/hooks.js.

Licence

MIT — part of the Watershed ecosystem.