A localStorage wrapper for all browsers without using cookies or flash, providing persistent client-side storage with automatic fallback and plugin architecture
75
Build a browser storage utility that works across different browsers and environments, including older browsers and privacy modes where standard storage may not be available.
Your utility should provide persistent key-value storage that:
The utility should attempt to use storage mechanisms in this order:
@generates
/**
* Stores a value under the given key
* @param {string} key - The storage key
* @param {any} value - The value to store (will be serialized)
*/
export function set(key, value);
/**
* Retrieves a value by key
* @param {string} key - The storage key
* @returns {any} The stored value, or undefined if not found
*/
export function get(key);
/**
* Checks if persistent storage is available
* @returns {boolean} true if persistent storage is working, false if using in-memory fallback
*/
export function isAvailable();Provides cross-browser local storage support.
Install with Tessl CLI
npx tessl i tessl/npm-storeevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10