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

google-news-extractor

v2.6.0

Published

Extract news articles and source links from Google News RSS feeds

Readme

📰 Google News Extractor

Search Google News and Google Search to extract article content with automatic URL resolution. Queries both sources in parallel and merges results.

Quick Start (npx)

# Install and run in one command
npx google-news-extractor -q "AI" -m 5

# Or install globally
npm install -g google-news-extractor
google-news -q "AI" -m 5

The first run will automatically download Chromium for URL resolution.

Command Line Usage

# Search news + web results (default: both sources)
google-news -q "OpenAI" -m 5

# News RSS only
google-news --news-only -q "OpenAI" -m 5

# Google Search only (web results)
google-news --web-only -q "GPU benchmarks" -m 5

# Browse a topic
google-news -t technology -m 10

# JSON output piped to jq
google-news -q "AI" -f json 2>/dev/null | jq

# Save to file
google-news -q "climate" -o results.md

# Sources only (fast, no content extraction)
google-news -q "business" -s

Options

--query, -q <term>        Search for specific news
--topic, -t <topic>       Browse: world, nation, business, technology,
                          entertainment, sports, science, health
--max, -m <number>        Max articles (default: 10)
--format, -f <type>       Output: pretty, markdown, json, text
--output, -o <file>       Save to file
--sources-only, -s        Only extract source links
--news-only               Only query Google News RSS
--web-only                Only query Google Search
--help, -h                Show help

Web Server

# Start the web server
./start.sh
# or
node server.mjs

# Open http://localhost:3000

API

curl -X POST http://localhost:3000/api/search \
  -H "Content-Type: application/json" \
  -d '{"query": "AI", "maxArticles": 5}'

Features

  • Dual Sources - Queries Google News RSS + Google Search in parallel, merges & deduplicates
  • Stealth Browser - Full anti-detection (webdriver, plugins, WebGL, human mouse/scroll)
  • DuckDuckGo Fallback - If Google blocks, falls back to DuckDuckGo HTML search
  • URL Resolution - Resolves Google News redirect URLs to actual article links via Playwright
  • Content Extraction - Extracts article paragraphs using readability-style scoring
  • Multiple Formats - Markdown, JSON, text, pretty terminal output
  • Topic Browsing - Browse by category (technology, business, sports, etc.)
  • Paywall Handling - Graceful fallback for paywalled content
  • Puppeteer Fallback - Falls back to headless Chrome when HTTP parsing isn't enough
  • Auto Setup - Automatically installs Chromium on first run

Requirements

  • Node.js 18+
  • Playwright Chromium (auto-installed on first run)

Project Structure

├── src/
│   ├── cli.ts            # CLI entry point
│   ├── index.ts          # Main library API
│   ├── rss.ts            # RSS feed parser + URL resolver orchestration
│   ├── google-search.ts  # Google Search scraper (HTTP + Puppeteer fallback)
│   ├── extractor.ts      # Content extraction
│   ├── fetcher.ts        # HTTP fetch with fallback
│   ├── gnews-resolver.ts # Playwright/Puppeteer URL resolver
│   ├── formatters.ts     # Output formatters
│   ├── utils.ts          # Shared utilities
│   └── types.ts          # TypeScript types
├── public/
│   └── index.html        # Web UI
├── server.mjs            # Web server
├── start.sh              # Quick start script
└── package.json

License

MIT