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

@capsuleer/browser

v1.0.1

Published

Web browsing module for capsuleer — search via Google and read webpages as clean markdown

Downloads

24

Readme

@capsuleer/browser

Web browsing module for Capsuleer agents. Search the internet via Google and read any webpage as clean, agent-readable markdown. The two tools work together — search() finds relevant pages, browse() reads them.

capsuleer install browser

Requires a Google Custom Search API key and Programmable Search Engine ID, supplied by Axon at capsule boot.


Setup

Create a Google Programmable Search Engine and enable it to search the entire web. Then get an API key from Google Cloud Console with the Custom Search API enabled.

Pass both to the capsule via env in your agent config:

capsule({
  name: "my-agent",
  env: {
    GOOGLE_API_KEY: process.env.GOOGLE_API_KEY!,
    GOOGLE_SEARCH_ENGINE_ID: process.env.GOOGLE_SEARCH_ENGINE_ID!,
  }
})

API

Search

const results = await browser.search("bun javascript runtime benchmarks")
// → {
//     query: "bun javascript runtime benchmarks",
//     total: 4210000,
//     results: [
//       { title: "Bun vs Node.js benchmarks", url: "https://...", snippet: "..." },
//       { title: "Runtime performance comparison", url: "https://...", snippet: "..." },
//       ...
//     ]
//   }

// Limit results (max 10, default 10)
const top3 = await browser.search("sqlite performance tips", { num: 3 })

Browse

const page = await browser.browse("https://bun.sh/docs/runtime/bunfig")
// → {
//     url: "https://bun.sh/docs/runtime/bunfig",
//     title: "bunfig.toml – Bun Docs",
//     markdown: "# bunfig.toml\n\nBun's per-project configuration file...",
//     byteLength: 8420,
//     durationMs: 312,
//   }

// Read the full content
console.log(page.markdown)

Scripts, styles, navbars, footers, iframes, and SVGs are stripped before conversion. What comes back is the readable content of the page — headings, paragraphs, lists, code blocks, and links.

Typical agent pattern

// 1. Search for relevant pages
const { results } = await browser.search("how to run PRAGMA optimize in sqlite")

// 2. Browse the most relevant result
const page = await browser.browse(results[0].url)

// 3. Reason about the content
console.log(page.markdown)

Observability

{ "ok": true, "op": "browser.search", "data": { "query": "bun benchmarks", "results": 10, "durationMs": 210 } }
{ "ok": true, "op": "browser.browse", "data": { "url": "https://...", "title": "Bun Docs", "bytes": 8420, "durationMs": 312 } }

Policy

const capsule = await Capsule({
  policy: {
    browser: {
      search: true,
      browse: { allow: ["https://*"], deny: ["http://*"] },  // https only
    }
  }
})

See the policy docs for the full rule syntax.


Notes

  • browse() returns raw markdown — large pages can be verbose. Consider truncating or summarising if passing directly to an LLM context window.
  • Google Custom Search is limited to 100 free queries/day. Beyond that, billing applies at ~$5/1000 queries.
  • search() does not require browse() — snippets alone are often enough for simple factual lookups.