A JavaScript library that proxies any storage-like object, adding syntax sugar, serialization, subscriptions, expiration, and disposable values.
Stokado is a JavaScript library that proxies storage-like objects such as localStorage, sessionStorage, or localForage. It solves the problem of cumbersome storage APIs by providing intuitive syntax sugar, automatic type serialization, and advanced features like subscriptions and expiration settings, making client-side storage more developer-friendly.
Frontend developers working with browser storage APIs who want a more ergonomic and feature-rich way to manage persistent data, especially those using localStorage, sessionStorage, or localForage in web applications.
Developers choose Stokado because it seamlessly enhances standard storage APIs with modern conveniences like property-based access, type preservation, and real-time subscriptions, all while maintaining full backward compatibility and interoperability with existing storage solutions.
stokado can proxy objects of any storage-like, providing getter/setter syntax sugars, serialization, subscription listening, expiration setting, one-time value retrieval.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Allows storage manipulation using dot notation (e.g., `storage.key = value`) instead of verbose `getItem`/`setItem` methods, as demonstrated in the syntax sugar section.
Automatically preserves JavaScript types including numbers, booleans, objects, arrays, Date, RegExp, and functions when storing and retrieving, ensuring data integrity without manual parsing.
Supports subscriptions to specific keys or nested properties with `on`, `once`, and `off` methods, enabling reactive updates across tabs or components with callback details.
Provides methods like `setExpires` to set expiration times using strings, numbers, or Date objects, useful for cache control and temporary data storage.
The proxy layer adds computational cost to storage operations, which might be noticeable in performance-sensitive applications with frequent reads and writes.
When used with async storages like localForage, it requires Promise-based calls (e.g., `await`), complicating the syntax and potentially negating some synchronous benefits.
For non-standard storage objects, the `name` parameter must be manually set to enable cross-page synchronization, adding configuration effort and room for error.