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

snaprender

v0.2.4

Published

Official Node.js SDK for SnapRender Screenshot API

Readme

snaprender

npm version npm downloads license

Official Node.js SDK for the SnapRender Screenshot API — capture pixel-perfect screenshots of any webpage with a single API call.

500 free screenshots/month — Get your API key

Features

  • Multiple output formats — PNG, JPEG, WebP, and PDF
  • Device emulation — iPhone, iPad, Pixel, and more presets
  • Dark mode — Capture pages with prefers-color-scheme: dark
  • Ad blocking — Remove ads automatically before capture
  • Cookie banner removal — Clean screenshots without consent popups
  • Smart caching — Configurable CDN cache with TTL control
  • Full-page captures — Screenshot the entire scrollable page

Install

npm install snaprender

Quick Start

import SnapRender from 'snaprender';
import fs from 'node:fs';

const snap = new SnapRender({ apiKey: 'sk_live_...' });

// Capture a screenshot
const buffer = await snap.capture({ url: 'https://example.com' });
fs.writeFileSync('screenshot.png', buffer);

// Capture as JPEG with options
const jpg = await snap.capture({
  url: 'https://example.com',
  format: 'jpeg',
  width: 1920,
  height: 1080,
  fullPage: true,
  darkMode: true,
  quality: 95,
});

// Check cache status
const info = await snap.info({ url: 'https://example.com' });
console.log(info.cached);   // true/false
console.log(info.expiresAt); // ISO date string (when cached)

// Get usage
const usage = await snap.usage();
console.log(`${usage.used}/${usage.limit} screenshots used`);

API

new SnapRender(options)

| Option | Type | Required | Default | |--------|------|----------|---------| | apiKey | string | Yes | — | | baseUrl | string | No | https://app.snap-render.com |

snap.capture(options) -> Promise<Buffer>

| Option | Type | Default | Description | |--------|------|---------|-------------| | url | string | — | URL to capture (required) | | format | 'png' \| 'jpeg' \| 'webp' \| 'pdf' | 'png' | Output format | | width | number | 1280 | Viewport width | | height | number | 800 | Viewport height | | fullPage | boolean | false | Capture full scrollable page | | quality | number | 90 | JPEG/WebP quality (1-100) | | delay | number | 0 | Wait ms after page load | | darkMode | boolean | false | Emulate dark mode | | blockAds | boolean | true | Block ad networks | | blockCookieBanners | boolean | true | Remove cookie banners | | device | string | — | Device preset ('iphone_14', 'iphone_15_pro', 'pixel_7', 'ipad_pro', 'macbook_pro') | | hideSelectors | string | — | Comma-separated CSS selectors to hide | | clickSelector | string | — | CSS selector to click before capture | | userAgent | string | — | Custom user agent string | | cache | boolean | true | Use cache | | cacheTtl | number | 86400 | Cache TTL in seconds | | responseType | 'binary' \| 'json' | 'binary' | 'json' returns metadata + base64 data URI |

snap.info(options) -> Promise<CacheInfo>

Check if a screenshot is cached without capturing. Returns { url, cached, cacheKey, cachedAt?, expiresAt?, contentType? }.

snap.usage() -> Promise<UsageResponse>

Get current month's usage.

snap.usageDaily(days?) -> Promise<DailyUsage>

Get daily usage breakdown (default 30 days).

Error Handling

import { SnapRenderError } from 'snaprender';

try {
  await snap.capture({ url: 'https://example.com' });
} catch (err) {
  if (err instanceof SnapRenderError) {
    console.log(err.code);    // 'QUOTA_EXCEEDED'
    console.log(err.status);  // 429
    console.log(err.message); // 'Monthly quota exceeded'
  }
}

Links

License

MIT