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

babelwrap

v0.1.0

Published

The web, as an API, for your agents. JavaScript/TypeScript SDK.

Downloads

45

Readme

BabelWrap JavaScript/TypeScript SDK

The official JavaScript/TypeScript SDK for BabelWrap — the web, as an API, for your agents.

Installation

npm install babelwrap

Quick Start

import { BabelWrap } from "babelwrap";

const bw = new BabelWrap({ apiKey: process.env.BABELWRAP_API_KEY! });
const session = await bw.createSession();

try {
  // Navigate to a page
  const snap = await session.navigate("https://news.ycombinator.com");
  console.log(snap.title); // "Hacker News"

  // Extract structured data
  const stories = await session.extract("top 5 story titles and their URLs");
  console.log(stories);
} finally {
  await session.close();
}

With TypeScript using (auto-cleanup)

import { BabelWrap } from "babelwrap";

const bw = new BabelWrap({ apiKey: process.env.BABELWRAP_API_KEY! });
await using session = await bw.createSession();

await session.navigate("https://example.com");
await session.fill("Email field", "[email protected]");
await session.fill("Password field", "secret");
await session.submit();

const data = await session.extract("the user profile information");

API Reference

BabelWrap

const bw = new BabelWrap({
  apiKey: "bw_...",          // Required
  baseUrl: "https://...",    // Default: https://api.babelwrap.com
  timeout: 60000,            // Default: 60s
  maxRetries: 3,             // Default: 3
});

Methods:

  • createSession(options?) — Create a new browser session
  • usage() — Get current usage stats
  • health() — Health check
  • mapSite(url, cookies?) — Map a website and generate typed tools
  • listSites() — List mapped sites
  • siteTools(siteId) — Get tools for a mapped site
  • executeTool(siteId, toolName, params?) — Execute a site tool

Session

All methods return a Snapshot (attribute-accessible page state) unless noted.

  • navigate(url) — Navigate to URL
  • click(target) — Click element by description
  • fill(target, value) — Fill form field
  • submit(target?) — Submit form
  • extract(query) — Extract structured data (returns object[] | object)
  • press(key) — Press keyboard key
  • scroll(direction?, amount?) — Scroll page
  • hover(target) — Hover over element
  • screenshot() — Take screenshot (returns base64 string)
  • upload(target, file, filename?) — Upload file
  • back() / forward() — Browser history
  • snapshot() — Read current page state
  • waitFor(options) — Wait for condition
  • history() — Get action history
  • batch(actions, continueOnError?) — Execute multiple actions
  • close() — Close session

Snapshot

Attribute-accessible wrapper for page state:

const snap = await session.navigate("https://example.com");
snap.url;                // "https://example.com"
snap.title;              // "Example Domain"
snap.inputs;             // Snapshot[] of form inputs
snap.inputs[0].label;    // "Email address"
snap.get("missing", "default"); // "default"
snap.toDict();           // Plain object

Requirements

  • Node.js 18+ (uses global fetch)
  • Zero runtime dependencies