Skip to content

nanostores-storage

Reactive storage for nanostores. Sync localStorage, sessionStorage, and custom backends with automatic cross-tab updates.

Why nanostores-storage?

While @nanostores/persistent provides simple localStorage persistence, nanostores-storage is designed for applications that need more:

  • Multiple storage backends — localStorage, sessionStorage, cookies, memory
  • Fallback chains — Graceful degradation across storage types
  • Full storage control — Monitor and manage entire storage contents
  • Built-in testing support — Memory adapter for unit tests and SSR

Features

Reactive Storage

Changes to storage automatically update your stores. No manual syncing required.

Cross-Tab Sync

Listen for changes from other browser tabs in real-time.

Fallback Chains

Use multiple storage backends with automatic fallback for graceful degradation.

Custom Adapters

Implement your own storage backends - cookies, encrypted storage, or anything else.