{"_id":"lib-streak-math","name":"lib-streak-math","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"lib-streak-math","version":"1.0.0","description":"Dependency-free calendar-day bucketing and streak math primitives, with an optional Node-only on-disk store. Helper for svelte-streak-lib.","type":"module","license":"MIT","exports":{".":{"types":"./index.d.ts","default":"./index.mjs"},"./store":{"types":"./store.d.ts","default":"./store.mjs"}},"keywords":["streak","calendar","day","analytics"],"types":"./index.d.ts","_id":"lib-streak-math@1.0.0","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-Y+aZLxPyK0QVca5oLwnPSiTep8DHd3YweMz0n8eIM3me+7GHw7eE/fT2YjEUtO2zxy1YJ9R//nbRTsm6RuGwvw==","shasum":"2ecc72530857b5ee201e8cf2844b7500846f78c4","tarball":"https://registry.npmjs.org/lib-streak-math/-/lib-streak-math-1.0.0.tgz","fileCount":7,"unpackedSize":14614,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHceZD82LGmZjtvShcT3INpTkBr1RaGL+DUmstntY6wSAiBgDFpZg17SBrpoOLBxwqu/DloP8X+R97pdkZ1cRF6PRw=="}]},"_npmUser":{"name":"caios_luv","email":"caios_luv@proton.me"},"directories":{},"maintainers":[{"name":"caios_luv","email":"caios_luv@proton.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/lib-streak-math_1.0.0_1785135139348_0.3613480417263515"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-27T06:52:19.275Z","1.0.0":"2026-07-27T06:52:19.495Z","modified":"2026-07-27T06:52:19.667Z"},"maintainers":[{"name":"caios_luv","email":"caios_luv@proton.me"}],"description":"Dependency-free calendar-day bucketing and streak math primitives, with an optional Node-only on-disk store. Helper for svelte-streak-lib.","keywords":["streak","calendar","day","analytics"],"license":"MIT","readme":"# lib-streak-math\n\nDependency-free calendar-day and streak-math primitives. This is the **helper**\npackage behind [`svelte-streak-lib`](../svelte-streak-lib); it is not meant to\nbe imported directly from application code.\n\n## API\n\n```js\nimport { dayKey, addDays, dayDiff, bucketByDay, qualifyingDayKeys } from 'lib-streak-math';\nimport { store } from 'lib-streak-math/store'; // Node-only\n```\n\n- `dayKey(date, timeZone?)` → `\"YYYY-MM-DD\"`\n- `addDays(key, n)` → shifted day key\n- `dayDiff(aKey, bKey)` → whole-day difference\n- `bucketByDay(entries, timeZone?)` → `Map<dayKey, total>`\n- `qualifyingDayKeys(entries, goal, timeZone?)` → sorted day keys meeting the goal\n\n","readmeFilename":"README.md","_rev":"1-0009da0a9571667df2c7a1209d15e500"}