safe-storage
JSON →safe-storage (v1.0.2) provides drop-in replacements for localStorage and sessionStorage that gracefully fall back to an in-memory implementation when the native browser storages are unavailable or throw errors (e.g., Safari private mode). No dependencies, no build step, and supports both ESM and CommonJS. Unlike other storage wrappers, it specifically targets the Safari private browsing bug and does not introduce any new API surface — it exactly mirrors the native Storage interface. Released in 2017, stable with no recent updates.
Resources
packagesafe-storage ↗