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

ai-news-digest

v1.0.4

Published

AI-powered news aggregator & digest generator — supports Gemini Browser/API modes, multi-source RSS/Sitemap/DOM/URL extraction, scheduled delivery via email.

Readme

ai-news-digest

AI-powered news aggregator & daily digest generator.

AI 驱动的新闻聚合与每日摘要生成工具。


Features / 功能特性

  • Dual AI Engine — Gemini API (recommended) or Gemini Browser (Playwright)
  • Multi-source Extraction — RSS, Sitemap, DOM scraping, direct URL
  • 智能去重 — SQLite-based deduplication across runs
  • Email Delivery — Auto-send daily digest via SMTP (QQ/Gmail/163/Outlook/Yahoo)
  • Scheduled Automation — Built-in node-cron scheduler (cross-platform)
  • Bilingual — Full zh/en i18n support
  • CLI-first — Interactive setup, one-command operation

Quick Start / 快速开始

Install / 安装

npm install -g ai-news-digest

Initialize / 初始化

ai-news init

Interactive setup will guide you through:

  1. AI engine selection (API key or Browser login)
  2. Email delivery configuration
  3. Language preference

Run / 运行

# Full pipeline: scrape + generate + email
ai-news run

# Scrape only
ai-news scrape

# Generate digest only
ai-news generate

Schedule / 定时运行

# Start scheduler (runs in foreground)
ai-news start

# Stop scheduler
ai-news stop

Commands / 命令

| Command | Description | |---------|-------------| | ai-news init | Interactive setup / 交互式初始化 | | ai-news auth status | Check Gemini Browser login status / 检查登录态 | | ai-news login | Browser login for Gemini (Browser mode only) | | ai-news run | Full pipeline: scrape → generate → email | | ai-news scrape | Scrape sources only | | ai-news generate | Generate digest from saved articles | | ai-news start | Start scheduled daemon | | ai-news stop | Stop daemon | | ai-news sources list | List all sources / 列出数据源 | | ai-news sources add <url> | Add a source | | ai-news sources remove <id> | Remove a source | | ai-news sources enable <id> | Enable a source | | ai-news sources disable <id> | Disable a source | | ai-news health | System health check / 健康检查 | | ai-news config | View config | | ai-news config get <key> | Get config value | | ai-news config set <key> <value> | Set config value |

Engine Modes / 引擎模式

Gemini API (Recommended / 推荐)

Uses the official Gemini API with an API key. No browser required.

# Get an API key from:
# https://aistudio.google.com/app/apikey
ai-news config set GEMINI_API_KEY your_key_here

Gemini Browser

Uses Playwright to control a real browser session with Gemini Web UI. Requires Google login.

ai-news auth status      # Preflight-check the saved login session
ai-news login   # Opens browser for manual login
ai-news scrape  # Uses saved session

ai-news auth status is intended for scripts and preflight checks:

ai-news auth status
ai-news auth status --json

if ai-news auth status >/dev/null 2>&1; then
  echo "session is valid"
else
  echo "login required"
fi

Exit codes:

  • 0: session is valid
  • 1: session is missing or login is required
  • 2: check failed due to setup or runtime error

Email Configuration / 邮件配置

Supported providers with presets:

| Provider | SMTP Host | |----------|-----------| | QQ Mail | smtp.qq.com | | Gmail | smtp.gmail.com | | 163 Mail | smtp.163.com | | Outlook | smtp.office365.com | | Yahoo | smtp.mail.yahoo.com |

Set via ai-news init or manually:

ai-news config set email.smtp.host smtp.gmail.com
ai-news config set email.smtp.port 465
ai-news config set SMTP_USER [email protected]
ai-news config set SMTP_PASS your_app_password
ai-news config set email.recipient [email protected]

Configuration / 配置

Config is stored at ~/.ai-news-digest/:

~/.ai-news-digest/
├── config.json      # Main config
├── sources.json     # Data sources
├── .env             # Secrets (API keys, SMTP credentials)
├── data/
│   ├── articles/    # Saved article analyses
│   ├── dedup/       # Deduplication database
│   └── state/       # Task state
├── output/
│   ├── html/        # Generated HTML digests
│   └── markdown/    # Generated markdown
└── logs/            # Scheduler logs

Schedule Configuration / 定时配置

Default schedule (cron expressions):

{
  "schedule": {
    "scrape": "0 * * * *",       // Every hour
    "generate": "0 8 * * *",     // Daily at 8am
    "cleanup": "0 2 * * 0"       // Weekly Sunday 2am
  }
}

Requirements / 系统要求

  • Node.js >= 18
  • OS: macOS, Linux, Windows
  • Gemini API Key (API mode) or Google account (Browser mode)
  • SMTP credentials (for email delivery)

License

MIT