{"_id":"korvica","name":"korvica","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"korvica","version":"1.0.0","description":"Calendar-day bucketing and streak math primitives, with an optional Node-only on-disk store. Helper for korvath.","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":"korvica@1.0.0","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-Roe0Mz9hkqWp02WTGyIQqUpt3/weMXRP0kilGzQUrGpcJQo0XkbRsFDqJmg3whijGJ3qmZDbjriivEvf1Fwj0Q==","shasum":"ce0788d634eaa656d94bb10a034770ce43eaef59","tarball":"https://registry.npmjs.org/korvica/-/korvica-1.0.0.tgz","fileCount":6,"unpackedSize":7560,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDA/TtS1oxGcGXSryGZQ2T0S63cAqN8l+tI9kVIHGcK/AiEAqSlFNNVMjpWxBZG6qpNRKs7sZ7dZTtqWSyoCDfaUhKM="}]},"_npmUser":{"name":"kilomev","email":"kilomev@protonmail.com"},"directories":{},"maintainers":[{"name":"kilomev","email":"kilomev@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/korvica_1.0.0_1784644537902_0.20968976553463992"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-21T14:35:37.815Z","1.0.0":"2026-07-21T14:35:38.025Z","modified":"2026-07-21T14:35:38.231Z"},"maintainers":[{"name":"kilomev","email":"kilomev@protonmail.com"}],"description":"Calendar-day bucketing and streak math primitives, with an optional Node-only on-disk store. Helper for korvath.","keywords":["streak","calendar","day","analytics"],"license":"MIT","readme":"# korvica\n\nCalendar-day and streak math primitives. The helper package for\n[`korvath`](../korvath), but usable on its own.\n\nTwo entry points:\n\n| import | environment | side effects |\n| --- | --- | --- |\n| `korvica` | anywhere — pure, browser-safe (Intl only) | none |\n| `korvica/store` | Node only (`node:fs`) | creates a cache dir under the OS temp dir on import |\n\n## `korvica`\n\n```js\nimport { dayKey, addDays, dayDiff, bucketByDay, qualifyingDayKeys } from 'korvica';\n\ndayKey('2026-07-20T09:00:00Z', 'UTC'); // '2026-07-20'\naddDays('2026-07-20', -1); // '2026-07-19'\ndayDiff('2026-07-20', '2026-07-18'); // 2\n```\n\n- `bucketByDay(entries, timeZone?)` — sums `{ date, value }` entries per calendar day.\n- `qualifyingDayKeys(entries, goal, timeZone?)` — sorted day keys whose total ≥ `goal`.\n\n## `korvica/store`\n\nA minimal JSON-on-disk memo store. Importing the module creates\n`store.dir` (`<os-tmp>/korvica-store`). It never touches the network.\n\n```js\nimport { store } from 'korvica/store';\n\nstore.set('key', { current: 3 });\nstore.has('key'); // true\nstore.get('key'); // { current: 3 }\n```\n\nBecause it uses `node:fs`, import it only from server-side code.\n","readmeFilename":"README.md","_rev":"1-1131abcd38609c988a2541a3506f4276"}