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

@crafter/li-metrics

v0.2.0

Published

Read-only LinkedIn post analytics CLI for authenticated browser sessions

Readme

li-metrics

Read-only LinkedIn post analytics CLI for an authenticated Dia session.

This is an unofficial project and is not affiliated with LinkedIn.

It uses agent-browser over CDP, keeps authentication inside the browser, and stores append-only receipts. It does not publish, react, comment, copy cookies, or call LinkedIn's internal RSC endpoints directly.

Requirements

  • Bun
  • agent-browser >=0.31.1 <0.34.0
  • unzip
  • Dia running with remote debugging on port 9222
  • An authenticated LinkedIn session in Dia

Setup

bun add -g @crafter/li-metrics
li-metrics doctor

For local development:

bun install
bun run src/cli.ts doctor

Native build

ScriptC can compile the CLI into a host-native executable:

bun run native:coverage
bun run native:build
./dist/li-metrics --json schema post.metrics
./dist/li-metrics doctor

The current build compiles 100% of analyzed statements statically and does not embed a JavaScript engine. Browser commands still require agent-browser, and XLSX imports require the system unzip executable.

Commands

li-metrics posts week
li-metrics posts week --no-details
li-metrics post metrics "https://www.linkedin.com/feed/update/urn:li:share:..."
li-metrics checkpoint capture "urn:li:share:..."
li-metrics backfill "urn:li:activity:..." "urn:li:activity:..."
li-metrics trend
li-metrics cohort --since 2026-06-30
li-metrics import xlsx ~/Downloads/SinglePostAnalytics_*.xlsx
li-metrics receipt list
li-metrics reconcile receipt-a.json receipt-b.json
li-metrics brief week
li-metrics schema

The default is concise, colored output for humans. Use --json for one machine-readable result or --ndjson for streams. Agents must always select one of those structured modes and must not parse the human presentation.

Set LI_METRICS_AGENT_BROWSER_BIN only when agent-browser is not on PATH.

backfill captures multiple posts sequentially and writes one append-only lifetime receipt per successful input. It continues after individual failures and exits nonzero when any input fails.

trend and cohort are local-only. trend compares the earliest and latest checkpoint for each post. cohort --since YYYY-MM-DD keeps the latest receipt for posts published on or after the selected date, ranks them by impressions, and reports engagement, profile-view, follower-conversion, and save rates. Publication dates are derived from LinkedIn activity or share URNs when a receipt does not include an explicit date.

Agent skill

Install the repository skill, then load the version-matched instructions from the CLI:

bunx skills add crafter-station/li-metrics -g
li-metrics skills get core
li-metrics skills get core --full

The installable discovery stub lives at skills/li-metrics/SKILL.md. The operational guide is served by the installed CLI so command guidance stays aligned with that release.

The browser provider currently supports LinkedIn's 7-day Content analytics view. Per-post detail values are lifetime snapshots. Capture consistent checkpoints before drawing causal conclusions because LinkedIn can revise metrics after publication.

English and Spanish LinkedIn interfaces are supported. Other interface languages fail explicitly instead of writing incomplete receipts.

XLSX imports are bounded to 25 MB compressed, 100 MB uncompressed, 1,000 ZIP entries, and 10,000 worksheet rows.

Releases

Releases use npm Trusted Publishing from .github/workflows/release.yml. Configure the npm publisher with:

  • Organization or user: crafter-station
  • Repository: li-metrics
  • Workflow filename: release.yml
  • Environment: none
  • Allowed action: npm publish

Run the Release workflow and select patch, minor, or major. The first run commits the version bump to main; the resulting push verifies, publishes, tags, and creates the GitHub release through OIDC.