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

earlyforge-sdk

v0.1.1

Published

JavaScript/TypeScript client for the EarlyForge Trends API (free Pulse mirror and full trends feed, every plan)

Readme

earlyforge-sdk

JavaScript/TypeScript client for the EarlyForge Trends API, with two tiers under the same /v1/api/trends/* prefix:

  • Pulse mirror — free on every account, no plan required. An authenticated mirror of the free, anonymous trend data already shown on pulse.earlyforge.ai: same daily snapshot, same trend count, same fields.
  • Full trends feed — every plan, including free, and not "all trends unlocked." Every plan reveals a daily, random, category-diversified budget of trend names (bigger on paid plans) — exactly what your organization's dashboard Trends page shows unlocked today, no more, no less. See fullTrends() below.

This is not a client for articles, briefs, or alerts — the public API never exposes those on any plan. Uses the global fetch, so it works in Node 18+ and in browsers with no other dependency.

Full reference: docs.earlyforge.ai/guides/api/javascript-sdk. Source: github.com/Earlyforge-official/earlyforge.

Install

Not published to npm yet. Contact [email protected] for early access.

Quickstart

ESM

import { PulseClient } from "earlyforge-sdk"

const client = new PulseClient("ef_live_xxxxxxxxxxxxxxxx")
const snapshot = await client.topTrends()
console.log(snapshot.trends[0])

CommonJS

const { PulseClient } = await import("earlyforge-sdk")
const client = new PulseClient("ef_live_xxxxxxxxxxxxxxxx")
const snapshot = await client.topTrends()

(The package ships ESM-only — a CommonJS require() consumer loads it via a dynamic import(), as shown above.)

Get a key from Settings → API Keys in the EarlyForge console — any account works, Pulse access is free.

Methods

topTrends({ date? })

Global top trends — same snapshot as the Pulse homepage.

const { trends, total, cached_at, cache_ttl_seconds } = await client.topTrends()
// trends[0] => {
//   trend_id: "tr_a1b2c3",
//   display_name: "AI regulation",
//   region: "US",
//   language: "en",
//   categories: ["politics"],
//   global_score: 87.5,
//   lifecycle_stage: "growing",
//   detected_at: "2026-11-04T08:00:00Z",
//   hours_since_detection: 6.2,
//   velocity_zscore: 2.1,
//   acceleration: 0.4,
//   n_sources: 12,
//   source_diversity: 0.8,
//   cross_lingual_root: false,
//   google_trends_lead_hours: null,
//   topic_class: null,
//   entities: [],
//   description: null
// }

trendsByRegion(region, { date? })

Top trends for an ISO 3166-1 alpha-2 region code (e.g. "US", "FR"). Same TrendList shape as topTrends.

trendsByCategory(category, { date? })

Top trends for a category (e.g. "politics", "tech"). Same TrendList shape as topTrends.

getTrend(trendId)

Detail for one trend. Same fields as a trend, plus canonical_name, sources, a full description, and a timeline of {ts, score, sources_count} points.

fullTrends({ region?, category?, page?, limit? })

Every plan, including free. A bigger, paginated slice of the trend corpus than the fixed Pulse snapshot — gated by the same daily random name-visibility budget as the dashboard (bigger budget on paid plans). Items outside today's budget stay in the list with their name fields redacted (name_locked: true), not removed.

const { items, total, page, per_page } = await client.fullTrends({ limit: 50 })
// items[1] => { trend_id: "tr_d4e5f6", display_name: "••••••••••", name_locked: true, ... }

getFullTrend(trendId)

Every plan, including free. Full detail for one trend — same TD-sourced fields as the dashboard's detail panel (topsis_score, editorial_title, etc.). Rejects with PulseApiError (statusCode === 402, detail.code === "trend_locked") if the trend is outside today's visible-name budget.

Errors

Every non-2xx response rejects with a PulseApiError carrying statusCode and detail (mirroring the OpenAPI spec's 401 missing/invalid/revoked key, 404 unknown trend, and 502 upstream unavailable responses). Network failures also reject with PulseApiError.

import { PulseApiError } from "earlyforge-sdk"

try {
  await client.getTrend("does-not-exist")
} catch (error) {
  if (error instanceof PulseApiError) {
    console.error(error.statusCode, error.detail)
  }
}

Rate limits

No monthly call quota on this surface, for any plan — only the shared 60 requests/60s burst limit applies, same as the anonymous Pulse page.

Tests

npm run build && npm test