Utilities for easy read and write browser's storage in Nuxt.js projects, wrapping localStorage and sessionStorage with a simple API. Version 1.2.2 (latest, not actively updated since 2019). Provides get, set (with expiry), and clear methods. Specifically solves the Nuxt SSR hydration issue where direct access to browser storage causes errors. A lighter alternative to larger libraries like vue-store or vue-web-storage.
npm install nuxt-storageNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Set, get, and clear localStorage with optional expiry (hours) using the default import.
Wrap usage with `if (process.client)` or use inside `mounted()`
Consider using localforage or integrating directly with browser Storage API
Do not manipulate localStorage keys manually if using nuxt-storage expiry
Use the exact import path as documented; check node_modules folder if unsure
Use `if (process.client)` before accessing, or call inside `mounted()` lifecycle hook
Create a manual declaration file: `declare module 'nuxt-storage/local-storage';`
Only store data serializable to JSON; use `JSON.stringify` before storing
No dependency data recorded yet.