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

screenshotty-js

v0.1.0

Published

Official JavaScript/TypeScript client for the Screenshotty screenshot API — capture pixel-perfect screenshots and PDFs of any website or HTML.

Readme

screenshotty-js

Official JavaScript / TypeScript client for the Screenshotty screenshot API — capture pixel-perfect screenshots and PDFs of any website or raw HTML with a single call.

CI npm license

  • 📸 Full-page, element, mobile, and PDF capture
  • 🌗 Dark mode, ad-blocking, cookie-banner removal, geo-targeting
  • 🧩 Zero runtime dependencies — uses the native fetch (Node 18+, Deno, Bun, browsers)
  • 🔒 Fully typed options and results

Powered by the Screenshotty screenshot API. Grab a free API key (1,500 screenshots/month, no card) in the dashboard and read the full API documentation.

Install

npm install screenshotty-js

Quick start

import { Screenshotty } from "screenshotty-js";

const client = new Screenshotty(process.env.SCREENSHOTTY_API_KEY!);

// Get raw PNG bytes
const png = await client.capture({ url: "https://example.com", fullPage: true });

// …or just the hosted URL
const url = await client.captureToUrl({ url: "https://example.com" });

// …or write straight to disk (Node.js)
await client.captureToFile({ url: "https://example.com" }, "example.png");

Examples

Mobile screenshot in dark mode:

await client.capture({
  url: "https://example.com",
  viewportPreset: "iphone_15_pro_max",
  lightMode: "dark",
});

Website → PDF:

const pdf = await client.capture({
  url: "https://example.com",
  format: "application/pdf",
  printed: true,
});

Capture a single element, clean of ads and cookie banners:

await client.capture({
  url: "https://news.example.com/article",
  selector: "article",
  adblock: true,
  blockCookieBanner: true,
});

Render raw HTML (great for OG images):

await client.capture({
  html: "<h1 style='font:700 64px sans-serif'>Hello 👋</h1>",
  viewportWidth: 1200,
  viewportHeight: 630,
});

Geo-targeted capture:

const countries = await client.countries(); // e.g. ["us", "de", "br", …]
await client.capture({ url: "https://example.com", country: "de" });

API

new Screenshotty(apiKey, options?)

| Option | Type | Default | |--------|------|---------| | baseUrl | string | https://api.screenshotty.link | | fetch | typeof fetch | global fetch |

Methods

| Method | Returns | Notes | |--------|---------|-------| | capture(options) | Promise<Uint8Array> | Raw image/PDF bytes | | captureToJson(options) | Promise<ScreenshotResult> | { url, width, height, mime } | | captureToUrl(options) | Promise<string> | Hosted screenshot URL | | captureToFile(options, path) | Promise<void> | Node.js only | | countries() | Promise<string[]> | Geo-targeting country codes |

ScreenshotOptions

camelCase options are mapped to the API's parameters automatically. See the full, always-current parameter reference in the Screenshotty API docs. Highlights: url / html, format, fullPage, selector, viewportWidth / viewportHeight / viewportPreset, deviceScaleFactor, crop*, lightMode, adblock, blockCookieBanner, country, javascriptCode / cssCode, httpHeaders / cookies, readyEvent / waitMs, webhookUrl.

Errors

Non-2xx responses throw a ScreenshottyError with .status and .body:

import { ScreenshottyError } from "screenshotty-js";

try {
  await client.capture({ url: "https://example.com" });
} catch (err) {
  if (err instanceof ScreenshottyError) {
    console.error(err.status, err.message, err.body);
  }
}

Development

npm install
npm run typecheck
npm test        # node --test with a mocked fetch
npm run build

Links

License

MIT © Nihey Takizawa