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

browsergrab

v1.0.0

Published

Official JavaScript/TypeScript SDK for the BrowserGrab Screenshot API

Downloads

15

Readme

browsergrab

Official JavaScript / TypeScript SDK for the BrowserGrab Screenshot API.

Capture pixel-perfect screenshots of any URL with a single function call. Works in Node.js, Deno, Bun, and any environment with the Fetch API.

Installation

npm install browsergrab
# or
yarn add browsergrab
# or
pnpm add browsergrab

Quick start

import BrowserGrab from "browsergrab";

const client = new BrowserGrab("bg_live_your_api_key");

const result = await client.screenshot({ url: "https://example.com" });
console.log(result.url); // https://cdn.browsergrab.app/screenshots/...

Get your API key from browsergrab.app/dashboard/keys.

Usage

Basic screenshot

const result = await client.screenshot({
  url: "https://stripe.com",
});
// result.url  — CDN URL to the PNG
// result.width, result.height, result.format

All options

const result = await client.screenshot({
  url: "https://github.com",

  // Output
  format: "webp",       // "png" | "jpeg" | "webp"  (default: "png")
  width: 1920,          // viewport width  (default: 1280)
  height: 1080,         // viewport height (default: 800)
  fullPage: true,       // capture full scrollable height (default: false)
  waitFor: 1500,        // extra ms to wait after load (default: 0)
  storage: "cloud",     // "cloud" | "gdrive" | "none" (default: "cloud")

  // Super plan only
  retina: true,         // 2× device pixel ratio
  darkMode: true,       // force prefers-color-scheme: dark
  blockAds: true,       // block ads before capture
  quality: 90,          // JPEG/WebP quality 1–100
});

Storage options

| storage | Result | |---|---| | "cloud" | Stored on BrowserGrab CDN — returns a permanent public URL | | "gdrive" | Saved to your connected Google Drive — returns a Drive link | | "none" | Returns a data:image/...;base64,... string, nothing stored remotely |

Error handling

import BrowserGrab, { BrowserGrabError } from "browsergrab";

const client = new BrowserGrab("bg_live_xxx");

try {
  const result = await client.screenshot({ url: "https://example.com" });
  console.log(result.url);
} catch (err) {
  if (err instanceof BrowserGrabError) {
    console.error(err.message);  // human-readable message
    console.error(err.code);     // machine-readable: "quota_exceeded", "invalid_api_key", etc.
    console.error(err.status);   // HTTP status code
    console.error(err.charged);  // false = no credit was used
  }
}

Common error codes

| Code | HTTP | Meaning | |---|---|---| | invalid_api_key | 401 | API key not found or revoked | | quota_exceeded | 429 | Monthly screenshot limit reached | | dimension_exceeds_plan | 403 | Resolution exceeds your plan limit | | feature_requires_super | 403 | retina/darkMode/blockAds need Super plan | | page_load_failed | 422 | Page couldn't load (DNS error, blank page) — not charged | | timeout | 0 | Request timed out client-side | | network_error | 0 | Network failure — not charged |

Client options

const client = new BrowserGrab("bg_live_xxx", {
  retries: 3,          // retry on 5xx errors (default: 2)
  timeoutMs: 60_000,   // request timeout in ms (default: 90000)
  baseUrl: "https://...", // override API base URL
});

Plans

| | Free | Super | |---|---|---| | Screenshots/month | 15 | 5,000 | | Max resolution | 1920×1080 | 3840×2160 | | Retina (2×) | ✗ | ✓ | | Dark mode | ✗ | ✓ | | Ad blocking | ✗ | ✓ | | Cloud storage | ✓ | ✓ | | Google Drive | ✗ | ✓ |

License

MIT