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 user preferences dashboard that displays and manages multiple user settings stored in browser storage.
Create a system that stores user preferences as key-value pairs and provides functionality to display all preferences in a formatted list. The system should support adding, viewing, and clearing preferences.
The system must store user preferences with the following structure:
Implement a function that generates a formatted display of all stored preferences:
Implement functionality to collect all preferences into a structured format suitable for export or display in a UI.
@generates
/**
* Stores a user preference with the given key and value
* @param {string} key - The preference name
* @param {*} value - The preference value (any serializable type)
*/
function setPreference(key, value) {
// IMPLEMENTATION HERE
}
/**
* Retrieves all stored preferences as an object
* @returns {Object} An object containing all key-value pairs of preferences
*/
function getAllPreferences() {
// IMPLEMENTATION HERE
}
/**
* Generates a formatted string displaying all preferences
* @returns {string} A formatted string with each preference on a new line
*/
function displayPreferences() {
// IMPLEMENTATION HERE
}
/**
* Clears all stored preferences
*/
function clearAllPreferences() {
// IMPLEMENTATION HERE
}
module.exports = {
setPreference,
getAllPreferences,
displayPreferences,
clearAllPreferences
};Provides cross-browser local storage functionality with automatic serialization.
@satisfied-by
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