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

@pep/browse-cli

v1.0.10

Published

Scrape any webpage to markdown using your browser session

Readme

browse

Scrape any webpage to markdown using your browser session

npm version License: MIT

Traditional web scrapers get blocked by Cloudflare, CAPTCHAs, and bot detection. browse sidesteps all of that by using your actual Chrome browser - the same session where you're already logged in and verified as human.

How It Works

Chrome Browser (with your logins)
        │
        ▼
  Browse Extension ←──→ WebSocket Daemon (port 9222)
        │                      │
        ▼                      ▼
   Page Content           browse CLI
        │                      │
        └──────────────────────┘
                  │
                  ▼
            Markdown Output

The Browse extension connects your authenticated browser sessions to the CLI via a local WebSocket daemon. This lets you scrape any page you can see in your browser - including sites that require login.

Installation

Homebrew (recommended)

brew tap pepijnsenders/tap
brew install browse

npm

npm install -g @pep/browse-cli

From source

git clone https://github.com/PepijnSenders/browse-cli
cd browse-cli
bun install
bun run build
npm link

Quick Start

1. Install the Chrome Extension

  1. Open chrome://extensions in Chrome
  2. Enable "Developer mode" (top right)
  3. Click "Load unpacked"
  4. Select the extension/ folder from this package

To find the extension folder after npm install:

npm root -g  # Shows global node_modules path
# Extension is at: <path>/browse-cli/extension

2. Start the Daemon

browse init

3. Scrape Any Page

browse https://example.com

Usage

# Basic usage - outputs markdown
browse <url>

# Output JSON with metadata (url, title, content)
browse <url> --json

# Output pruned HTML instead of markdown
browse <url> --html

# Wait longer for dynamic content (default: 2000ms)
browse <url> --wait 5000

# Scroll for infinite-scroll pages
browse <url> --scroll 3

Commands

| Command | Description | |---------|-------------| | browse <url> | Scrape URL and output markdown | | browse init | Start the WebSocket daemon | | browse stop | Stop the daemon | | browse --help | Show help | | browse --version | Show version |

Options

| Option | Description | Default | |--------|-------------|---------| | --json | Output JSON with url, title, and content | - | | --html | Output pruned HTML instead of markdown | - | | --wait <ms> | Wait time after page load | 2000 | | --scroll <n> | Number of scroll iterations | 0 |

Examples

News Articles

browse https://techcrunch.com/2024/01/15/some-article

Social Media (requires login in browser)

# Twitter/X
browse https://x.com/elonmusk

# LinkedIn
browse https://linkedin.com/in/satyanadella

Infinite Scroll Pages

# Scroll 5 times to load more content
browse https://news.ycombinator.com --scroll 5

Get Structured Output

# JSON with metadata
browse https://example.com --json | jq .

# Output:
# {
#   "url": "https://example.com",
#   "title": "Example Domain",
#   "content": "# Example Domain\n\nThis domain is for..."
# }

Claude Code Integration

This package includes a Claude Code skill for natural language web scraping.

Install the Plugin

# In Claude Code, run:
/plugin marketplace add PepijnSenders/browse-cli
/plugin install browse@PepijnSenders-browse-cli

Usage

Once installed, Claude can scrape pages naturally:

You: Get the content from https://news.ycombinator.com
Claude: [runs: browse https://news.ycombinator.com]

You: Scrape this Twitter profile and scroll to get more tweets
Claude: [runs: browse https://x.com/openai --scroll 3]

Troubleshooting

"Connection refused" or "Daemon not running"

Start the daemon:

browse init

"Extension not connected"

  1. Make sure the Browse extension is installed in Chrome
  2. Check that the extension icon shows "Connected" when clicked
  3. Refresh the page you want to scrape

"No content returned"

Some pages load content dynamically. Try:

browse <url> --wait 5000  # Wait longer
browse <url> --scroll 2   # Scroll to trigger lazy loading

"Login required"

Log into the website in your Chrome browser first. The CLI uses your existing browser session.

Extension not finding the daemon

Make sure port 9222 is available:

lsof -i :9222  # Check if something else is using the port
browse stop    # Stop any existing daemon
browse init    # Start fresh

Why Not Just Use Puppeteer/Playwright?

Traditional headless browsers and scrapers fail on modern websites because:

  • Cloudflare/Akamai detect and block headless browsers
  • CAPTCHAs stop automated requests
  • Login walls require maintaining complex session management
  • Fingerprinting identifies non-human browser signatures

browse bypasses all of this because it's not pretending to be a browser - it IS your browser, with your cookies, your login sessions, and your human verification already done.

| Feature | browse | Puppeteer/Playwright | curl/wget | |---------|--------|---------------------|-----------| | Bypasses Cloudflare | Yes | Rarely | No | | Bypasses CAPTCHAs | Yes | No | No | | Uses existing logins | Yes | No | No | | JavaScript rendering | Yes | Yes | No | | Blocked by rate limits | Rarely | Often | Often |

Development

# Install dependencies
bun install

# Run in development mode
bun run dev

# Type check
bun run typecheck

# Run tests
bun test

# Build for distribution
bun run build

# Lint
bun run lint

Architecture

  • src/cli.ts - Commander.js CLI interface
  • src/daemon.ts - WebSocket relay server
  • src/scrape.ts - Core scraping logic
  • src/utils/html-parser.ts - Turndown-based HTML to markdown conversion
  • extension/ - Chrome extension (Manifest V3)

Requirements

  • Node.js >= 18.0.0
  • Chrome browser
  • Browse extension installed

License

MIT