{"id":49463,"library":"superstore-sync","title":"superstore-sync","description":"A synchronous wrapper around localStorage and sessionStorage that automatically handles JSON serialization/deserialization and provides resilience to iOS private browsing mode quirk. Current stable version is 2.1.1. Maintained with minimal releases; key differentiators include built-in JSON handling and protection against iOS Storage bugs.","status":"active","version":"2.1.1","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/matthew-andrews/superstore-sync","tags":["javascript","localstorage","sessionstorage"],"install":[{"cmd":"npm install superstore-sync","lang":"bash","label":"npm"},{"cmd":"yarn add superstore-sync","lang":"bash","label":"yarn"},{"cmd":"pnpm add superstore-sync","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-style import since v2; avoid CommonJS destructuring if using ESM.","wrong":"const local = require('superstore-sync').local","symbol":"local","correct":"import { local } from 'superstore-sync'"},{"note":"Both local and session can be imported as named exports.","wrong":"var store = require('superstore-sync'); store.session","symbol":"session","correct":"import { session } from 'superstore-sync'"},{"note":"isPersisting is also a named export; v2 supports named imports.","wrong":"const store = require('superstore-sync'); store.isPersisting","symbol":"isPersisting","correct":"import { isPersisting } from 'superstore-sync'"},{"note":"Default export is the module itself; no .default needed with ESM.","wrong":"const store = require('superstore-sync').default","symbol":"default","correct":"import store from 'superstore-sync'"}],"quickstart":{"code":"import { local, session, isPersisting } from 'superstore-sync';\n\n// Set and get from local storage\nlocal.set('name', { first: 'Alice', last: 'Smith' });\nconst name = local.get('name');\nconsole.log(name.first); // 'Alice'\n\n// Set and get from session storage\nsession.set('sessionId', 12345);\nconst id = session.get('sessionId');\nconsole.log(id); // 12345\n\n// Clear all keys starting with 'foo'\nlocal.clear('foo');\n\n// Check persistence status\nconsole.log(isPersisting()); // true unless storage is full/unavailable\n\n// Remove a specific key\nlocal.unset('name');\n\n// Unset from session\nsession.unset('sessionId');","lang":"typescript","description":"Shows how to use local, session, isPersisting, clear, unset with automatic JSON handling."},"warnings":[{"fix":"Always check for null: const val = local.get('key'); if (val !== null) { ... }","message":"The get() method can return null if the key does not exist. Code assuming object return may break.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"For CJS: const store = require('superstore-sync'); store.local.set(...). For ESM: import { local } from 'superstore-sync'.","message":"Using require('superstore-sync') returns a module object; local/session are properties, not top-level exports in CJS. Named imports are available via ESM.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use local.set(key, null) or local.unset(key) as documented.","message":"The #unset method is deprecated in favor of #removeKey (if available) or using delete operator directly on Storage. However, superstore-sync does not support removeKey; unset still works.","severity":"deprecated","affected_versions":">=2.0.0"}],"env_vars":null,"search_vec":"'2.1.1':29 'around':7 'automat':12 'brows':22 'bug':47 'built':38 'built-in':37 'current':25 'differenti':35 'handl':13,41 'includ':36 'io':20,45 'javascript':48 'json':14,40 'key':34 'localstorag':8,49 'maintain':30 'minim':32 'mode':23 'privat':21 'protect':43 'provid':17 'quirk':24 'releas':33 'resili':18 'serialization/deserialization':15 'sessionstorag':10,50 'stabl':26 'storag':46 'superstor':2 'superstore-sync':1 'sync':3 'synchron':5 'version':27 'wrapper':6","created_at":"2026-06-07T17:01:54.235052+00:00","updated_at":"2026-06-07T17:01:54.235052+00:00","problems":[{"fix":"Use const store = require('superstore-sync'); store.local.get(...)","cause":"Using destructuring with CommonJS require: const { local } = require('superstore-sync')","error":"TypeError: local.get is not a function"},{"fix":"Use store.local.set(...) or import named exports with ESM.","cause":"Importing default as 'store' in CommonJS but trying to use store.set(...) directly (store is the module, not local/session).","error":"Cannot read property 'set' of undefined"},{"fix":"Use a polyfill or only use in browser context. superstore-sync relies on window.localStorage.","cause":"Running in Node.js environment where localStorage is not available.","error":"localStorage is not defined (ReferenceError)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/matthew-andrews/superstore-sync#readme","github":"ssh://git@github.com/matthew-andrews/superstore-sync","docs":null,"changelog":null,"pypi":null,"npm":"superstore-sync","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}