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

scrapbook

v0.0.51

Published

Visual Regression Suite

Readme

ScrapBook

ScrapBook is a visual regression suite for testing web based user interfaces. Scrapbook will run user defined test scripts and take snapshots. These snapshots are compared over time to detect unintentional changes.

Getting Started

Install the module

npm install scrapbook -G

Generate a configuration file

scrapbook init

This will output a scrapbook.json file that contains properties describing the test runtime.

Run the test

scrapbook run

This will output a results.json file containing the hash of screenshot data and whether the change has been approved or not.

Running scrapbook validate will ensure that all changes have been approved.

Review the changes

scrapbook review

This will launch a UI to view what has changed and to accept or deny the differences.

Configuration Settings

{
	"url": "http://example.com",
	"flows": [{
		"name": "Default user flow",
		"source": "./steps.json",
		"viewport": ["desktop", "mobile"]
	}],
	"results": {
		"dir": "reports",
		"reportFile": "report.json"
	},
	"viewPorts": {
		"desktop": {
	    "width": 1400,
	    "height": 1900,
	    "deviceScaleFactor": 0,
	    "mobile": false,
	    "fitWindow": false
	  }
	}
}

Defining user flows

Sample flow

[
  {
    "script": "window.document.body.style.backgroundColor = \"red\";",
    "description": "turn the background red",
    "wait": 1000
  },
  {
    "snapshot" : {
      "description" : "ensure background color is red",
      "ticketId": "1234",
      "stepId": "step1"
    }
  },
  {
    "snapshot" : {
      "domId" : "domId",
      "description" : "what is being tested",
      "ticketId": "1234",
      "stepId": "step2"
    }
  },
  {
    "wait": 1000
  }
]

Steps

User flows are defined as arrays of user steps and run synchronously. Steps can be a script, snapshot, or exec.

Script

Scripts are plain javascript that are used to interact with the DOM.

Exec

Exec is used to run steps that interact with the browser and attributes of the Chrome Debugger Protocol.

Snapshot

Snapshots are used to compare the visual state of the UI.