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

@a1local/adpages-browser-capture

v0.1.0

Published

Dependency-free capture adapters that turn saved HTML and future rendered URLs into AdPages audit snapshots.

Readme

@a1local/adpages-browser-capture

Adapter layer for turning saved HTML now, and rendered URLs later, into @a1local/adpages-audit-core snapshots.

This package is intentionally small:

  • no runtime dependencies
  • no Playwright import yet
  • no remote crawling in the package itself
  • no storage, analytics, or licensing logic

Static HTML Capture

Use captureStaticHtmlSnapshot when a CLI, GitHub Action, local script, or Docker job already has HTML available from disk or stdin.

import { auditLandingPageSnapshot } from "@a1local/adpages-audit-core";
import { captureStaticHtmlSnapshot } from "@a1local/adpages-browser-capture";

const snapshot = captureStaticHtmlSnapshot(html, {
  url: "https://example.com/landing?utm_source=google&utm_medium=cpc&utm_campaign=brand",
  sourceLabel: "saved preview HTML"
});

const audit = auditLandingPageSnapshot(snapshot);

The helper returns the PageAuditSnapshot shape used by audit core. It does not depend on document, window, JSDOM, or browser APIs, so it is safe for Node-only workflows.

Static capture is best for pre-rendered HTML, build artifacts, and existing saved-page audits. It will not see client-rendered content, redirects, cookies, layout, computed accessibility state, network requests, or browser console errors.

CLI Path

The first CLI integration should keep fetching and file I/O outside this package:

  1. Read HTML from --html-file, stdin, or a wrapper-owned URL fetch.
  2. Call captureStaticHtmlSnapshot(html, { url, sourceLabel }).
  3. Pass the snapshot to auditLandingPageSnapshot.
  4. Render text, Markdown, JSON, or CI-friendly output in the CLI wrapper.

When URL capture is added, the CLI can accept a rendered-browser adapter that implements BrowserCaptureAdapter without making this package depend on Playwright.

GitHub Action Path

For the existing saved-HTML Action, this package can replace duplicated extraction logic:

  1. Checkout the site or receive a preview artifact.
  2. Read the saved HTML file.
  3. Build a snapshot with captureStaticHtmlSnapshot.
  4. Run audit core and publish the report.

For future preview URL audits, the Action should own browser installation, cache settings, secrets, timeouts, and failure policy. The rendered capture implementation can live beside the Action and satisfy the adapter type exported here.

Docker Path

A Docker image can provide the heavier runtime without pushing those dependencies into this package:

  1. Install the browser runtime in the image.
  2. Run the adapter against one or more URLs.
  3. Emit audit-core-compatible snapshots.
  4. Run audit core and write reports to mounted output paths.

This keeps local package installs fast while still allowing reproducible URL audits in CI.

Future Remote Capture

Remote capture should be explicit, user-initiated, and monetisation-safe:

  • require a supplied URL or preview URL; do not crawl arbitrary sites by default
  • keep request timeouts, max pages, and concurrency bounded
  • avoid collecting form inputs, cookies, local storage, or authenticated data unless a wrapper explicitly owns that flow
  • keep paid-gating, account state, and license checks outside this package
  • return deterministic snapshot data that audit core can evaluate locally

The intended future shape is:

import type { BrowserCaptureAdapter } from "@a1local/adpages-browser-capture";

export const captureWithPlaywright: BrowserCaptureAdapter = async (request) => {
  // Wrapper-owned Playwright code goes here later.
  // Return a PageAuditSnapshot compatible with @a1local/adpages-audit-core.
};