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

hn-get

v0.1.1

Published

Agent-friendly Hacker News CLI for search, stories, comments, users, and live HN lists.

Readme

hn-get

hn-get is a Hacker News CLI for agents, scripts, and terminal use.

It fetches stories, comments, users, live lists, favorites, jobs, and search results. JSON is the default output because agents should not have to scrape terminal text. Markdown and text output are there when you want something easier to read.

The CLI uses two public data sources.

  • Hacker News Firebase API for live items, users, and official story lists.
  • Algolia Hacker News Search API for full-text search, author feeds, comments, and older posts.

Install hn-get

npx hn-get help
npm install -g hn-get

Start with these commands

hn-get frontpage --limit 30
hn-get search "sqlite" --limit 10
hn-get search "vector database" --sort points --since 30d
hn-get show --sort points --since 30d --limit 20
hn-get item 40956979 --comments --depth 2 --comments-limit 20
hn-get user pg
hn-get comments "react compiler" --limit 10
hn-get whoishiring jobs --limit 20

Search and filter Hacker News

hn-get search "sqlite"
hn-get comments "sqlite"
hn-get search "llm" --type story --points 100 --comments 20
hn-get search "postgres" --since 2025-01-01 --until 2025-12-31
hn-get show --sort points --points 100 --comments 20

Search and section commands default to newest first. That is usually the closest match to the live site feed. Use --sort points when you want popular posts.

Dates accept ISO dates or relative durations.

  • 24h
  • 7d
  • 2w
  • 6mo
  • 1y

Browse live lists and sections

hn-get top
hn-get newest
hn-get frontpage
hn-get best
hn-get active
hn-get ask
hn-get show
hn-get jobs
hn-get polls
hn-get launches
hn-get bestcomments

Read stories and comments

hn-get item 40956979
hn-get item 40956979 --comments
hn-get item 40956979 --feed
hn-get item-comments 40956979 "sqlite"
hn-get replies 40956979

item returns the Firebase item by default. Add --comments when you want a bounded comment tree. Add --feed when you want searchable comment results for that item.

Get user activity

hn-get user pg
hn-get user pg --submitted-limit 20
hn-get user pg --feed
hn-get submitted pg
hn-get threads pg
hn-get replies pg
hn-get favorites pg

user returns the profile plus submittedCount. It does not print the full submitted ID list unless you add --submitted or --submitted-limit.

Search hiring threads

hn-get whoishiring
hn-get whoishiring jobs
hn-get whoishiring hired
hn-get whoishiring freelance

Choose an output format

Default output is pretty JSON.

hn-get search "rust" --format json
hn-get frontpage --format compact
hn-get newest --format ndjson
hn-get show --sort points --format markdown
hn-get item 40956979 --comments --format text

The output formats are:

| Format | Use it when | | --- | --- | | json | You want readable structured output. | | compact | You want compact JSON for scripts. | | ndjson | You want one JSON object per row. | | markdown | You want readable Markdown. HN HTML is converted with Defuddle. | | text | You want a plain terminal view. |

Get command help

Help is available at root and for every subcommand.

hn-get help
hn-get help search
hn-get item --help

Limits that keep commands safe

  • Search results are capped at 100 per command.
  • List results are capped at 500 per command.
  • Comment tree fetching is capped and depth-limited.
  • Upstream network calls use timeouts and retries.
  • The CLI does not use auth, cookies, browser state, credentials, or local config.

Work on the package locally

corepack enable
pnpm install
pnpm run build
pnpm test
pnpm run lint