CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-store

tessl install tessl/npm-store@2.0.0

A 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%

task.mdevals/scenario-4/

Versioned Storage Plugin

Build a storage versioning plugin that tracks versions of stored values and allows retrieval of previous versions.

Capabilities

Version Tracking

The plugin should automatically track versions each time a value is updated. When a key is set, the plugin should preserve the previous value along with metadata about when it was stored.

Version Retrieval

The plugin should allow retrieval of previous versions of a stored key, including the ability to get the most recent version or a specific historical version by index.

Version Listing

The plugin should provide a way to see all stored versions for a given key, including metadata about each version.

Test Cases

  • Setting "user" to "Alice", then "Bob", then "Charlie" creates three versions in history @test
  • Calling getVersion("user", 0) returns "Alice", getVersion("user", 1) returns "Bob" @test
  • listVersions("user") returns an array with three entries, each containing the value and timestamp @test
  • Setting a key that doesn't exist yet creates the first version @test

Implementation

@generates

API

// Plugin function that returns an object with extended methods
function versionedStoragePlugin() {
  return {
    set: function(super_fn, key, value) { /* ... */ },
    getVersion: function(key, versionIndex) { /* ... */ },
    listVersions: function(key) { /* ... */ }
  };
}

export default versionedStoragePlugin;

Dependencies { .dependencies }

store { .dependency }

Provides cross-browser local storage with plugin architecture.

@satisfied-by

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/store@2.0.x
tile.json