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

@lacspace/trends

v1.1.0

Published

Trending topics and hashtags for a region from official/public sources only — Google Trends daily RSS (geo), YouTube Data API mostPopular (optional key), and Wikipedia pageviews — merged across scripts and scored (multi-source terms rank up), with story-r

Readme

@lacspace/trends

Trending topics and hashtags for a region — from official/public sources only, with story-relevance gating so you never trend-jack. Merges Google Trends daily RSS, YouTube mostPopular (optional key) and Wikipedia pageviews across scripts, scores them (multi-source terms rank up), scores each against your story, and builds per-platform hashtag sets with limits and a shadow-ban filter.

npm i @lacspace/trends
import { trends, hashtagsFor } from "@lacspace/trends";

const { trends: list, sources, warnings } = await trends({
  geo: "NP",
  youtubeApiKey: process.env.YOUTUBE_API_KEY,   // optional
  relevanceTo: "NEPSE index rose as investors returned", // optional: gate to your story
  minRelevance: 0.3,
});
// list → [{ term, score, sources:["google","wikipedia"], volume, links, relevance }]

hashtagsFor(list.map((t) => t.term), "instagram"); // ["#Dashain", "#NEPSE", …] capped at 30

Why

Picking trending topics/hashtags by hand misses the window; asking an LLM "what's trending" invents or hallucinates. trends pulls only real, official/public signals, merges them deterministically, and — crucially — scores each trend's relevance to your story so you ride only topics you can legitimately cover.

Sources (official/public only)

  • Google Trends daily trending-searches RSS for a geo (with approx traffic + news links).
  • YouTube Data API videos.list chart=mostPopular regionCode — optional, needs an API key.
  • Wikipedia pageviews top articles (free REST API, no key; ne.wikipedia or en.wikipedia).

Each source is bring-your-own-fetch; a failing source becomes a warnings entry, never a thrown error.

API

  • trends(options) → { trends, sources, warnings }. Options: geo, sources, youtubeApiKey, wikipediaProject, relevanceTo (+ minRelevance), fetch, signal.
  • mergeTrends(raw[]) → merges raw trends across scripts (Dashain ≡ दशैं) and boosts multi-source agreement.
  • relevanceTo(trends, story, { min? }) → attaches a 0–1 relevance (token overlap via @lacspace/keyphrase + @lacspace/translit), optionally filtering. From 1.1.0 a shared common word is never enough. A trend must match on a distinctive term (proper noun, entity, rare word) or as a whole phrase. Name-like trends (River Phoenix) need the full name in the story, and single common-word trends are capped at 0.2. Plurals and -ed/-ing forms are stemmed, so floods matches flood. COMMON_TERMS is exported.
  • hashtagsFor(terms, platform, { banned?, max?, extra? }) → camel-cased, de-duplicated hashtags within the platform limit (IG 30, X 3, TikTok 6…), dropping banned/shadow-ban-prone tags.
  • Source fns googleTrendsDaily, youtubeMostPopular, wikipediaTop and parseGoogleTrendsRss are exported.
  • describe() → machine-readable command schema for an AI "conductor".

Merging is exact-key (after cross-script romanization) so it never fuses two genuinely different topics; differently-phrased mentions stay separate by design.

Licence

Lacspace Free Licence v1.0 — free for personal and commercial use.