{"_id":"@0xsarwagya/durable-local","name":"@0xsarwagya/durable-local","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@0xsarwagya/durable-local","version":"0.1.0","description":"Named durable values for the browser. No database, no state manager, no sync engine.","type":"module","license":"MIT","repository":{"type":"git","url":"git+https://github.com/0xsarwagya/durable-local.git"},"homepage":"https://oss.sarwagya.wtf/durable-local","keywords":["persistence","indexeddb","browser","storage","state","durable","typescript"],"sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"publishConfig":{"access":"public"},"devDependencies":{"@playwright/test":"1.61.1","@types/node":"^22.15.3","fake-indexeddb":"^6.0.0","tsup":"^8.3.5","typescript":"5.9.2","vite":"^5.4.11","vitest":"^3.0.0"},"scripts":{"build":"tsup && tsc -p tsconfig.build.json","check-types":"tsc --noEmit","test":"vitest run","test:unit":"vitest run","test:e2e":"playwright test","test:e2e:lifecycle":"playwright test --project=chromium-lifecycle --project=firefox-lifecycle --project=webkit-lifecycle","test:e2e:cross-tab":"playwright test --project=chromium-cross-tab --project=firefox-cross-tab --project=webkit-cross-tab","test:e2e:install":"playwright install --with-deps"},"_id":"@0xsarwagya/durable-local@0.1.0","bugs":{"url":"https://github.com/0xsarwagya/durable-local/issues"},"_integrity":"sha512-dixuedRsXGPh7+FMAkNidIx3VBpXYaGv98EP89ixXjh8hOfZu+jLR2mYza20g4jiV2UhfViWRD60Vnt3F+YKSQ==","_resolved":"/tmp/13603a3aaeb0bd9432d5823d1be4ddfd/0xsarwagya-durable-local-0.1.0.tgz","_from":"file:0xsarwagya-durable-local-0.1.0.tgz","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-dixuedRsXGPh7+FMAkNidIx3VBpXYaGv98EP89ixXjh8hOfZu+jLR2mYza20g4jiV2UhfViWRD60Vnt3F+YKSQ==","shasum":"16a770fe6f6a61ce795105e789a20aeccdce22a6","tarball":"https://registry.npmjs.org/@0xsarwagya/durable-local/-/durable-local-0.1.0.tgz","fileCount":25,"unpackedSize":102687,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@0xsarwagya%2fdurable-local@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDLlE6l3p58KLpe3pLFP2vT5o9m+Pjvp4ItdLEc7gN5/AiADuXapeX7e3tgGYuEIJtI7bcTJOm6UghzoOks8gVsymA=="}]},"_npmUser":{"name":"0xsarwagya","email":"sarwagyasingh69@gmail.com"},"directories":{},"maintainers":[{"name":"0xsarwagya","email":"sarwagyasingh69@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/durable-local_0.1.0_1783285509798_0.782053682040657"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-05T21:05:09.652Z","0.1.0":"2026-07-05T21:05:09.934Z","modified":"2026-07-05T21:05:10.253Z"},"maintainers":[{"name":"0xsarwagya","email":"sarwagyasingh69@gmail.com"}],"description":"Named durable values for the browser. No database, no state manager, no sync engine.","homepage":"https://oss.sarwagya.wtf/durable-local","keywords":["persistence","indexeddb","browser","storage","state","durable","typescript"],"repository":{"type":"git","url":"git+https://github.com/0xsarwagya/durable-local.git"},"bugs":{"url":"https://github.com/0xsarwagya/durable-local/issues"},"license":"MIT","readme":"# durable-local\n\nNamed durable values for the browser.\n\nA TypeScript library that gives a browser tab one thing: an application\nvalue that survives close and reload. No database, no state manager, no\nsync engine. The application owns the value. The package owns its\nsurvival.\n\n## Install\n\n```\npnpm add @0xsarwagya/durable-local\n```\n\n## Use\n\n```ts\nimport { createDurable } from \"@0xsarwagya/durable-local\";\n\nconst durable = createDurable();\n\nconst workspace = await durable.open(\"workspace\", {\n  initial: { title: \"Untitled\", blocks: [] },\n});\n\nworkspace.value; // { title: \"Untitled\", blocks: [] }\n\nawait workspace.update((current) => ({\n  ...current,\n  title: \"Something\",\n}));\n\n// Close the tab. Come back tomorrow. Still there.\n```\n\nEvery commit is atomic — subscribers only see values that survived a\nsuccessful IndexedDB transaction. Cross-tab observation is built in.\n\n## Boundaries\n\n- **Not a database.** No queries, collections, indexes, joins.\n- **Not a state manager.** No actions, reducers, middleware.\n- **Not sync.** State stays on the device; the package does not touch\n  the network.\n- **Not encryption.** Storage is not confidentiality.\n\nIf you need any of those, this package is not what you want.\n\n## Guarantees\n\n- Committed values survive reload.\n- Failed writes preserve the previous committed value.\n- Concurrent updates do not silently overwrite one another.\n- Migration failure preserves the previous committed value.\n- Cross-tab commits are eventually observed.\n- Invalid stored state is never returned as `T`.\n\n## Browsers\n\nRuns on IndexedDB. Tested on every commit in Chromium, Firefox, and\nWebKit via Playwright.\n\n## Docs and demo\n\n- Docs: https://oss.sarwagya.wtf/durable-local/docs\n- Demo: https://oss.sarwagya.wtf/durable-local/demo\n\n## License\n\nMIT.\n","readmeFilename":"README.md","_rev":"1-32bf4ef361102573655e508129605825"}