Skip to content

Installation

Prerequisites

nanostores-storage requires nanostores as a peer dependency.

Install

bash npm install @vp-tw/nanostores-storage nanostores

Framework Integrations

nanostores supports React, Vue, Svelte, Solid, Preact, Angular, and more. See nanostores integrations for setup instructions.

Example with React:

Terminal window
npm install @nanostores/react

TypeScript

nanostores-storage is written in TypeScript and includes type definitions. No additional @types packages needed.

Browser Support

nanostores-storage works in all modern browsers that support:

  • localStorage / sessionStorage
  • StorageEvent for cross-tab synchronization
BrowserSupported
Chrome 4+
Firefox 3.5+
Safari 4+
Edge 12+
IE 8+

Bundle Size

nanostores-storage is designed to be lightweight:

ExportSize (minified + gzip)
createStorageStore~800 bytes
createStorageValuesStore~900 bytes
localStorageAdapter~400 bytes
sessionStorageAdapter~400 bytes

The library is fully tree-shakeable — only import what you use.

Next Steps

Continue to the Quick Start guide to create your first storage store.