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

@0xkobold/pi-cloudflare-browser

v0.1.0

Published

Cloudflare Browser Rendering for pi-coding-agent

Readme

🌐 Pi Cloudflare Browser

Cloudflare Browser Rendering for pi-coding-agent.

Web scraping, screenshots, and PDF generation via Cloudflare's Browser Rendering API.

Features

  • 🕷️ Web crawling - Multi-page with depth control
  • 📸 Screenshots - Inline display + saved files
  • 📄 PDF generation - From any URL
  • 📄 Content extraction - Rendered HTML/Markdown
  • 🎯 Standalone - Works without 0xKobold
  • 🔌 Integrable - Exposes client for custom use

Installation

# Via pi CLI
pi install npm:@0xkobold/pi-cloudflare-browser

# Or in pi-config.ts
extensions: ['npm:@0xkobold/pi-cloudflare-browser']

Setup

  1. Get Cloudflare credentials:

    • Account ID: https://dash.cloudflare.com (right sidebar)
    • API Token: My Profile → API Tokens → Create → "Browser Rendering" template
  2. Configure:

export CLOUDFLARE_API_TOKEN=your_token
export CLOUDFLARE_ACCOUNT_ID=your_account_id
export PI_OUTPUT_DIR=./outputs  # Optional: where to save files

Usage

Standalone

import { CloudflareClient, loadConfig } from '@0xkobold/pi-cloudflare-browser';

// Load from env
const config = await loadConfig();
const client = new CloudflareClient(config);

// Take screenshot
const result = await client.screenshot('https://example.com', { fullPage: true });
// result.screenshot = base64 image
// result.metadata = { title, url, status }

// Crawl website
const crawlId = await client.crawl({
  url: 'https://example.com',
  limit: 10,
  render: true,
});

// Get crawl results
const crawl = await client.getCrawlResult(crawlId);

With pi-coding-agent

// Extension auto-registers tools:
// /cf_crawl      - Multi-page crawling
// /cf_screenshot - Capture screenshot
// /cf_pdf        - Generate PDF
// /cf_fetch      - Single page content

Tools

| Tool | Description | Example | |------|-------------|---------| | /cf_crawl | Crawl multiple pages | /cf_crawl url:https://example.com limit:20 | | /cf_screenshot | Screenshot (shows inline) | /cf_screenshot url:https://example.com fullPage:true | | /cf_pdf | Generate PDF | /cf_pdf url:https://example.com | | /cf_fetch | Fetch rendered content | /cf_fetch url:https://example.com |

API

CloudflareClient

class CloudflareClient {
  async crawl(params: CrawlParams): Promise<string>;      // Returns job ID
  async getCrawlResult(jobId: string): Promise<CrawlResult>;
  async screenshot(url: string, opts?: ScreenshotOptions): Promise<ScreenshotResult>;
  async pdf(url: string, opts?: PdfOptions): Promise<PdfResult>;
  async fetchContent(url: string, opts?: ContentOptions): Promise<ContentResult>;
}

Configuration

| Variable | Required | Description | |----------|----------|-------------| | CLOUDFLARE_API_TOKEN | ✅ | Account API token | | CLOUDFLARE_ACCOUNT_ID | ✅ | Account ID | | PI_OUTPUT_DIR | - | Save directory | | PI_CLOUDFLARE_VAULT | - | Obsidian vault path |

Standalone Example

// screenshot.ts - No pi-coding-agent needed
import { CloudflareClient, loadConfig } from '@0xkobold/pi-cloudflare-browser';

async function main() {
  const config = await loadConfig();
  if (!config.enabled) {
    console.log('Set CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID');
    return;
  }

  const client = new CloudflareClient(config);
  
  const result = await client.screenshot('https://example.com', {
    fullPage: true,
  });

  // Save to file
  await Bun.write('screenshot.png', Buffer.from(result.screenshot, 'base64'));
  console.log('Saved!');
}

main();

Links

License

MIT