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

@roottale/analytics-runtime

v0.2.0

Published

RootTale analytics runtime (ADR-0038) — Consent Mode v2 fail-closed tag loader, consent banner, and first-party data-track beacon. Framework-agnostic strings + optional React drop-in (<RootTaleAnalytics>).

Readme

@roottale/analytics-runtime

ADR-0038 plane ① (외부 트래커 주입) + 동의(Consent Mode v2 fail-closed) + plane ② (first-party 비콘) 의 프레임워크/DB 무관 런타임. 문자열만 산출하므로 cms-renderer-astro·cms-renderer-next 가 동일하게 mount 한다.

⚠️ 주입 규칙

set:html / dangerouslySetInnerHTML 로 주입한 <script>실행되지 않는다. 본 패키지 함수는 JS 본문 또는 HTML 마크업 만 반환하고, 렌더러가 JS 는 실제 <script> 엘리먼트로 감싼다.

  • Astro: <script is:inline set:html={js} />
  • Next: <script dangerouslySetInnerHTML={{ __html: js }} />

head 주입 (순서 중요)

  1. renderConsentBootstrap()가장 먼저. Consent Mode v2 default 전부 denied.
  2. renderLoaderScript(manifest) — 태그 로더. 동의 update 전 미발화(fail-closed).
import {
  buildManifest,
  renderConsentBootstrap,
  renderLoaderScript,
} from "@roottale/analytics-runtime";

const manifest = buildManifest({ siteId, tags }); // tags = SiteAnalyticsTagsRepo.listForSite()
const bootstrap = renderConsentBootstrap();
const loader = renderLoaderScript(manifest);

body 주입

  • renderConsentBannerMarkup(opts) — 배너 HTML(컨테이너로 주입). 기본 숨김.
  • renderConsentBannerScript() — 배너 동작 JS(선택→updateConsent+localStorage).
  • renderBeaconScript({ collectUrl, siteId }) — plane ② data-track dispatcher. cookieless·anonymized 라 동의 게이트 없이 동작(ADR-0038 §2).

Astro mount 예시 (web-front/src/layouts/BaseLayout.astro)

---
import {
  buildManifest, renderConsentBootstrap, renderLoaderScript,
  renderConsentBannerMarkup, renderConsentBannerScript, renderBeaconScript,
} from "@roottale/analytics-runtime";
const { manifest, siteId, collectUrl, privacyUrl } = Astro.props;
const bootstrap = renderConsentBootstrap();
const loader = renderLoaderScript(manifest);
const beacon = renderBeaconScript({ collectUrl, siteId });
const bannerJs = renderConsentBannerScript();
---
<head>
  <script is:inline set:html={bootstrap} />
  <script is:inline set:html={loader} />
  <!-- ...기존 SEO 메타... -->
</head>
<body>
  <slot />
  <Fragment set:html={renderConsentBannerMarkup({ privacyUrl })} />
  <script is:inline set:html={bannerJs} />
  <script is:inline set:html={beacon} />
</body>

[slug].astrogetBuildClient()site.id/site.tenantId 를 얻고, SiteAnalyticsTagsRepo(db, tenantId).listForSite(siteId)buildManifestBaseLayout props 로 전달.

상태 (ADR-0038)

  • ✅ 로직·산출물·동의 배너·비콘 dispatcher (본 패키지, 단위 테스트)
  • ⏳ web-front mount (workspace dep 등록 = pnpm install 후 BaseLayout 주입)
  • ⏳ plane ② /collect 엔드포인트 (tenant-api + CF Analytics Engine)
  • ⏳ plane ③ GA4/GSC ETL + getWeeklyVisitors()