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

@rezzed.ai/xfetch

v0.1.0

Published

Social media content extraction via Playwright

Downloads

26

Readme

@rezzedai/xfetch

Extract social media content from Twitter/X posts — no API keys required.

npx xfetch https://x.com/user/status/123456789

What It Does

  • Extracts post text, author info, and engagement metrics from Twitter/X
  • Captures thread content and image alt text
  • Uses Playwright browser automation to parse live DOM content
  • Returns clean JSON output for downstream processing
  • Works with both x.com and twitter.com URLs

Install

npm install @rezzedai/xfetch

Requirements: Node.js 18+, Playwright (installed automatically)

First run installs Chromium browser:

npx playwright install chromium

Quick Start

CLI:

# Basic extraction
xfetch https://x.com/user/status/123

# Pretty-printed output
xfetch --pretty https://x.com/user/status/123

# Skip thread loading (faster)
xfetch --no-scroll https://x.com/user/status/123

# Custom timeout
xfetch --timeout 60000 https://x.com/user/status/123

Programmatic:

import { fetchPost } from '@rezzedai/xfetch';

const post = await fetchPost('https://x.com/user/status/123456789');
console.log(post.text);
console.log(post.metrics.likes);

// With options
const post = await fetchPost('https://x.com/user/status/123', {
  timeout: 60000,
  scroll: false,  // Skip thread loading
  headless: true  // Run browser in background
});

CLI Reference

| Flag | Default | Description | |------|---------|-------------| | --pretty | false | Pretty-print JSON output | | --timeout N | 30000 | Page load timeout in milliseconds | | --no-scroll | false | Skip scrolling (faster, may miss thread content) | | -h, --help | — | Show help message |

Programmatic API

import { fetchPost, PostData, FetchOptions } from '@rezzedai/xfetch';

// Main function
async function fetchPost(
  url: string,
  options?: FetchOptions
): Promise<PostData>

// Options
interface FetchOptions {
  timeout?: number;    // default: 30000ms
  headless?: boolean;  // default: true
  scroll?: boolean;    // default: true (load thread content)
}

Examples:

// Extract with default settings
const post = await fetchPost('https://x.com/user/status/123');

// Custom timeout, skip thread
const post = await fetchPost('https://x.com/user/status/123', {
  timeout: 60000,
  scroll: false
});

// Visible browser (for debugging)
const post = await fetchPost('https://x.com/user/status/123', {
  headless: false
});

Output Format

interface PostData {
  url: string;            // Original post URL
  platform: "twitter";    // Platform identifier
  author: string;         // Display name
  handle: string;         // @username
  text: string;           // Full post text
  metrics: {
    replies: string | null;
    reposts: string | null;
    likes: string | null;
    views: string | null;
    bookmarks: string | null;
  };
  images: string[];       // Alt text for images
  timestamp: string | null;
  thread: Array<{         // Thread replies
    author: string;
    handle: string;
    text: string;
    metrics: PostMetrics;
  }>;
}

Example output:

{
  "url": "https://x.com/user/status/123",
  "platform": "twitter",
  "author": "John Doe",
  "handle": "@johndoe",
  "text": "Just shipped a new feature!",
  "metrics": {
    "replies": "42",
    "reposts": "18",
    "likes": "156",
    "views": "3.2K",
    "bookmarks": "7"
  },
  "images": ["Screenshot of new feature"],
  "timestamp": "2:30 PM · Feb 15, 2026",
  "thread": []
}

| Property | Type | Notes | |----------|------|-------| | Runtime | Playwright + Chromium | Full JavaScript rendering | | Dependencies | playwright | Auto-installs browser binaries | | Timeout | 30 seconds (default) | Configurable via --timeout or options | | Thread Loading | 5 scroll passes | Can be disabled with --no-scroll | | User-Agent | Custom Mozilla/5.0 | Avoids bot detection | | Error Handling | Graceful browser cleanup | Ensures no orphaned processes |

Why Not...?

Twitter API? Costs $100/month for basic access, requires OAuth setup, has strict rate limits, and needs ongoing key management. xfetch works immediately with zero configuration.

Web scraping with cheerio/axios? Twitter serves a skeleton HTML shell — all content loads via JavaScript. Static scrapers see empty <div> tags. xfetch uses Playwright to render the full page just like a real browser.

Manual copy-paste? Doesn't scale. xfetch extracts structured data from hundreds of posts in minutes, ready for analysis or archival.

Browser DevTools? Works for one-off tasks, but xfetch is scriptable, CI-friendly, and outputs clean JSON instead of raw HTML.

What's Next?

More tools coming from the @rezzedai toolkit. See rezzed.ai for updates.

Turn social media monitoring from a manual chore into an autonomous workflow.

License

MIT


Built by Rezzed — the AI product studio.