tessl install tessl/npm-store@2.0.0A localStorage wrapper for all browsers without using cookies or flash, providing persistent client-side storage with automatic fallback and plugin architecture
Agent Success
Agent success rate when using this tile
75%
Improvement
Agent success rate improvement when using this tile compared to baseline
0.96x
Baseline
Agent success rate without this tile
78%
A utility that manages session-specific data with the ability to reset all stored information.
@generates
The implementation should provide a simple module that:
/**
* Initializes the storage with default values if not already set.
*
* @param {Object} defaults - An object containing default key-value pairs
*/
function initialize(defaults) {
// IMPLEMENTATION HERE
}
/**
* Stores a value under a specific key.
*
* @param {string} key - The key to store the value under
* @param {*} value - The value to store (will be automatically serialized)
*/
function setData(key, value) {
// IMPLEMENTATION HERE
}
/**
* Retrieves a value by its key.
*
* @param {string} key - The key to retrieve
* @returns {*} The stored value, or undefined if not found
*/
function getData(key) {
// IMPLEMENTATION HERE
}
/**
* Clears all stored data from the storage.
*/
function resetAll() {
// IMPLEMENTATION HERE
}
module.exports = {
initialize,
setData,
getData,
resetAll
};Provides cross-browser local storage support.
Package: store@2.0.12