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

@puralex/webshot

v2.3.0

Published

High-efficiency batch screenshot tool with full-page stitching support.

Readme

📸 Webshot

A lightning-fast, production-ready batch screenshot tool built with Node.js, Puppeteer, and Sharp. Designed for high-performance web archiving and automated testing.

NPM Version License: ISC


🚀 Quick Start (No Install)

Run Webshot immediately without local installation using npx:

npx @puralex/webshot https://acme.com

🚀 Features

  • ⚡ Parallel Processing: Concurrently processes URLs in batches of 5, dramatically reducing capture time for large lists.
  • 🔗 Unicode Filenames: Advanced naming logic that correctly decodes percent-encoded URLs and preserves non-Latin (Cyrillic, etc.) characters in filenames.
  • 🏗️ Full-Page Stitching: Intelligently captures extremely tall pages (up to 16,384px) by tiling and stitching captures with Sharp to avoid GPU memory limits.
  • 🛡️ Smart Overlay Removal: Automatically identifies and hides cookie banners, GDPR consents, and popups to ensure a clean capture.
  • 📌 Sticky Header Handling: Fixes position: fixed and sticky headers so they appear only once at the top of the image instead of repeating across tiles.
  • 📜 Enhanced Lazy Loading: Deliberate autoscroll logic and waitForImages utility ensure all lazy-loaded assets are fully rendered before capture.
  • 📱 Responsive Breakpoints: Built-in support for standard Tailwind/Bootstrap breakpoints or custom pixel-perfect widths.

Install globally to use the magnifito-webshot command anywhere:

npm install -g @puralex/webshot
# or
pnpm add -g @puralex/webshot

[!NOTE] The command is named magnifito-webshot to avoid collisions with the legacy webshot-cli package.


🛠️ Usage

CLI Examples

Once installed, use the magnifito-webshot command:

# Basic capture
magnifito-webshot https://acme.com

# Batch capture from file (processed in parallel batches of 5)
magnifito-webshot -f urls.txt

# Specify custom output directory and responsive breakpoint
magnifito-webshot https://acme.com -o ./dist -b lg

# Use custom pixel width (overrides breakpoints)
magnifito-webshot https://acme.com -w 1440

CLI Options Reference

| Option | Shorthand | Description | Default | | :--- | :--- | :--- | :--- | | --file | -f | Path to a text file with one URL per line | - | | --output | -o | Target directory for saved images | ./screenshots | | --breakpoint | -b | sm, md, lg, xl, 2xl | 1920px | | --width | -w | Custom width in pixels | - | | --format | -F | Output format: png, jpg, webp | png | | --quality | -q | Quality for jpg/webp (1-100) | - | | --delay | -d | Wait time in ms after scrolling | 0 | | --no-scroll | - | Skip auto-scrolling | - |


🏗️ Architecture & Technical Details

Webshot uses a multi-stage capture pipeline to ensure high-fidelity results:

graph TD
    A[User/CLI Input] --> B[cli.js]
    B --> D[index.js Core Engine]
    D --> E[Puppeteer / Chromium]
    E --> F[removeOverlays]
    F --> G[Smart Autoscroll]
    G --> H[waitForImages]
    H --> I[fixStickyElements]
    I --> J[Tiled Capture]
    J --> K[Sharp Stitching]
    K --> L[Final Image]
  • Smart Autoscroll: Performs an incremental scroll-and-wait routine to trigger lazy-loaded assets.
  • Layout Stabilization: Automatically hides modals/banners and converts sticky elements to absolute positioning to prevent duplication in full-page images.
  • Hybrid Capture: Uses a single full-page capture for normal pages and a tiled stitching approach for "infinite scrollers" or very long articles.

❓ Troubleshooting

  • Puppeteer Dependency Errors: If running on Linux, you may need to install specific system libraries (libnss3, libatk, etc.).
  • Memory Limits: Extremely long pages might use significant RAM during stitching. If crashes occur, try reducing the MAX_TEXTURE_HEIGHT in index.js.
  • Navigation Timeout: For slow websites, increased browser protocol timeouts are pre-configured to 2 minutes.

🛠️ Development

Local Installation

git clone https://github.com/magnifito/webshot.git
cd webshot
npm install

Running Tests

npm test

Local Development (Auto-reload)

npm run dev

🤝 Contributing

  1. Fork the repository.
  2. Create your feature branch (git checkout -b feature/AmazingFeature).
  3. Commit your changes (git commit -m 'Add some AmazingFeature').
  4. Push to the branch (git push origin feature/AmazingFeature).
  5. Open a Pull Request.

📄 License

ISC © Kiril Kirov