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

@rosbel/crawl-n-snap

v1.1.5

Published

CLI tool for taking website screenshots at various resolutions using Playwright, with optional website crawling functionality.

Downloads

16

Readme

Crawl-n-Snap

A CLI tool for taking website screenshots at various resolutions using Playwright, with optional website crawling functionality.

npm version npm downloads package phobia ci status publish status license

Features

  • Take full page screenshots at specified resolutions
  • Capture multiple resolutions in a single run
  • Built-in presets for desktop and mobile devices
  • Optional website crawling to automatically capture linked pages
  • Configurable crawl depth and maximum page limits
  • Support for Chromium, Firefox, and WebKit browsers
  • Organized output directory structure with automatic run numbering

Installation

# Install globally
npm install -g @rosbel/crawl-n-snap

# Or using pnpm
pnpm add -g @rosbel/crawl-n-snap

Browser binaries need to be installed (if not already present):

# Using npm
npx playwright install

# Using pnpm
pnpx playwright install

Usage

You can use it directly if installed globally:

crawl-n-snap https://example.com [options]

Or run it without installing:

# Using npm
npx @rosbel/crawl-n-snap https://example.com [options]

# Using pnpm
pnpx @rosbel/crawl-n-snap https://example.com [options]

Options

Arguments:
  url                     The full URL (including http/https) of the page to screenshot.

Options:
  -r, --resolution <WxH>  Custom screen resolution (e.g., 1920x1080). Repeatable.
  -d, --desktop           Capture desktop resolutions (1920x1080)
  -m, --mobile            Capture mobile resolutions (390x844)
  -o, --output <dir>      Base output directory for screenshots (default: current directory)
  -b, --browser <n>       Browser to use (chromium, firefox, webkit) (default: "chromium")
  -c, --crawl             Enable crawling of all relative links on the website
  -p, --max-pages <n>     Maximum number of pages to crawl (only used with --crawl) (default: 50)
  -t, --timeout <ms>      Early screenshot timeout in milliseconds (default: 5000, max Playwright timeout: 30000)
  -V, --version           Output the version number
  -h, --help              Display help for command

Examples

Take a screenshot at the default resolution (1920x1080)

# npm
npx @rosbel/crawl-n-snap https://example.com

# pnpm
pnpx @rosbel/crawl-n-snap https://example.com

Take screenshots at multiple custom resolutions

npx @rosbel/crawl-n-snap https://example.com -r 1920x1080 -r 1366x768 -r 375x667

Use preset device resolutions

npx @rosbel/crawl-n-snap https://example.com --desktop --mobile

Crawl a website and take screenshots of all linked pages

npx @rosbel/crawl-n-snap https://example.com --crawl --max-pages 10

Use a different browser (Firefox) and custom output directory

npx @rosbel/crawl-n-snap https://example.com --browser firefox --output ./screenshots

Set a custom early screenshot timeout (5 seconds)

npx @rosbel/crawl-n-snap https://example.com --timeout 5000

Note: The tool will attempt to take a screenshot after the specified timeout even if the page is still loading. Playwright has a fixed maximum timeout of 30 seconds for network idle.

Output Structure

Screenshots are saved with the following structure:

<output_dir>/generated-screenshots/<hostname>/<date>/<run_number>/<resolution>-<path>.png

For example:

./generated-screenshots/example.com/20240328/1/1920x1080-root.png
./generated-screenshots/example.com/20240328/1/1920x1080-about.png

Development

Testing

This project uses Vitest for unit testing. Run the tests with:

# Run tests once
pnpm test

# Run tests in watch mode
pnpm test:watch

Linting

ESLint is configured for code quality. Run the linter with:

# Check for issues
pnpm lint

# Fix automatically fixable issues
pnpm lint:fix

CI/CD

This project uses GitHub Actions for continuous integration and deployment:

Continuous Integration

The CI workflow runs on pull requests to the main branch and includes:

  • Automated testing
  • Code linting
  • Build verification

Publishing to npm

Automatic publishing to npm occurs when changes are merged to the main branch.

To set up automatic publishing:

  1. Generate an npm token with publishing rights
  2. Add the token as a repository secret named NPM_TOKEN in your GitHub repository settings

Contributors

License

MIT