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

news-curator

v0.2.1

Published

AI-assisted news selection CLI with Supabase + OpenRouter

Readme

News Curator

AI‑assisted news selection CLI, designed for open source use. It fetches recent news items from a Supabase table, asks an LLM (via OpenRouter) to rank and deduplicate, then updates each item with a queued status. Includes a safe dry‑run mode that prints chosen items without writing to the database. By DailyUncle.com. ภาษาไทยอยู่ด้านล่าง

Features

  • Structured prompt (TH) optimized for technology/science/innovation news
  • Dedupes and limits final picks to a fixed K
  • Dry‑run mode for previewing selections
  • JSON log output for pipelines
  • Supabase integration using service role key

Requirements

  • Node.js 18+
  • Supabase project with a feed_items table
  • OpenRouter API key

Install

Clone the repo and install dependencies:

npm install

Copy .env.example to .env and fill values:

cp .env.example .env

Use via npx (no clone)

You can run the CLI directly without cloning by using npx (uses the published package):

npx news-curator --dry-run

Or install globally:

npm i -g news-curator
news-curator --dry-run

Live Demo

https://dailyuncle.com

Configure

Required environment variables:

  • SUPABASE_URL: Your Supabase project URL
  • SUPABASE_SERVICE_ROLE_KEY: Service role key
  • OPENROUTER_API_KEY: OpenRouter API key

Optional defaults:

  • OPENROUTER_MODEL (default: tngtech/deepseek-r1t2-chimera:free)
  • NEWS_SELECT_HOURS (default: 48)
  • NEWS_SELECT_LIMIT (default: 100)
  • NEWS_SELECT_FINAL_K (default: 12)

Build

npm run build

This creates the CLI at bin/news-curator.js which loads dist/index.js.

Usage

Run with Node (requires build):

news-curator --dry-run

Or during development without building:

npx tsx src/index.ts --dry-run

Options:

--hours <n>    Look back N hours (default: 48)
--limit <n>    Fetch at most N items (default: 100)
--final <k>    Target number to queue (default: 12)
--model <name> OpenRouter model (env OPENROUTER_MODEL)
--dry-run      Do not write to DB; print selections
--json         Emit JSON logs only
--help         Show help

Example (dry‑run):

news-curator --hours 36 --limit 80 --final 12 --dry-run

Publishing

For maintainers: the package is configured for npm publish. The build runs automatically on npm publish/npm pack via prepack.

# Update version as needed
npm version patch

# Publish to npm (unscoped, public)
npm publish

Supabase schema

Minimum required columns on feed_items (types shown for reference):

  • id (uuid or text, primary key)
  • title (text)
  • url (text)
  • summary (text, nullable)
  • published_at (timestamp with time zone, nullable)
  • status (text) — expected values include ready and completed
  • queued_status (text) — one of queued|skipped|duplicate|low_quality|clickbait|out_of_scope
  • selection_reason (text, nullable)

Example SQL (adjust types/constraints as needed):

-- ids may be text or uuid depending on your pipeline
create table if not exists public.feed_items (
  id text primary key,
  title text not null,
  url text not null,
  summary text,
  published_at timestamptz,
  status text not null default 'ready',
  queued_status text,
  selection_reason text
);

Prompt

The selection prompt (Thai) is tailored to pick high‑quality, non‑duplicative, tech/science/innovation news. It instructs the model to return only a strict JSON array and to label each item with a queued_status and short reason.

Notes

  • The tool adjusts to ensure exactly K items are marked queued per run.
  • If the model returns fewer than K, it fills from the input order to reach K.
  • Set --dry-run while tuning prompts and defaults.

(TH) คำอธิบายภาษาไทย

News Curator เป็น CLI ช่วยคัดเลือกข่าวด้วย AI ออกแบบให้เปิดเผยซอร์ส ใช้งานง่าย และตั้งค่าได้ โดยจะดึงข่าวล่าสุดจาก Supabase (feed_items) ส่งให้โมเดลผ่าน OpenRouter เพื่อคัดและตัดซ้ำ แล้วอัปเดตสถานะที่ฐานข้อมูล มีโหมด Dry‑run สำหรับทดสอบโดยไม่เขียนข้อมูลจริง

จุดเด่น:

  • Prompt ภาษาไทย เน้นข่าว เทคโนโลยี/วิทยาศาสตร์/นวัตกรรม
  • เลือกข่าวที่ดีที่สุด และไม่ซ้ำกัน ในจำนวน K รายการ
  • Dry‑run โชว์ผลที่เลือกโดยไม่แตะฐานข้อมูล
  • Log แบบ JSON เหมาะกับ workflow อัตโนมัติ

ติดตั้งและใช้งาน:

  1. เติมค่าใน .env (ดูตัวอย่าง .env.example)
  2. รัน npm run build
  3. รัน news-curator --dry-run เพื่อทดสอบ

ตัวเลือกสำคัญ:

  • --hours ชั่วโมงย้อนหลัง (ค่าเริ่มต้น 48)
  • --limit จำนวนสูงสุดที่ดึง (ค่าเริ่มต้น 100)
  • --final จำนวน K ที่ต้องการเลือก (ค่าเริ่มต้น 12)
  • --model เลือกโมเดล OpenRouter
  • --dry-run แสดงผลโดยไม่เขียนฐานข้อมูล

สคีมาที่ใช้บน Supabase ดูหัวข้อ “Supabase schema” ด้านบน

License

MIT