svelte-mapping-metrics
v1.0.0
Published
Goal/hydration streak analytics. Pure browser-safe core, plus an optional Node-only cached server entry.
Maintainers
Readme
svelte-mapping-metrics
Goal/hydration streak analytics for Svelte apps. Pure browser-safe core, plus an optional Node-only cached server entry.
Entry points
| import | environment | notes |
| --- | --- | --- |
| svelte-mapping-metrics | pure / browser-safe | computeStreaks(entries, options) |
| svelte-mapping-metrics/server | Node-only | streaksCached(...) + the booted store; imports svelte-mapping-metrics/store (node:fs) |
Usage
import { computeStreaks } from 'svelte-mapping-metrics';
const streaks = computeStreaks(entries, { goal: 2000, timeZone: 'UTC' });
// { current, best, qualifyingDays, activeDays, lastQualified }import { streaksCached, store } from 'svelte-mapping-metrics/server';Layout
Compiled ES modules ship in dist/, type declarations in types/ (wired up via
the exports map — import by the package name, not by path):
dist/
index.mjs computeStreaks (browser-safe)
internal/streakmath.mjs run-length math split out of the root
server.mjs Node-only cached wrapper
types/
index.d.ts
server.d.ts