A lightweight JavaScript library providing a unified API for sessionStorage and localStorage in the browser. Version 1.1.1 is the stable release. It simplifies storage operations with methods like set, get, remove, clear, and iteration support. Key differentiator: same API for both storage types with a namespace for sessionStorage.
npm install good-storageNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage of good-storage: setting/getting localStorage and sessionStorage, checking keys, removing, clearing, and iterating.
Ensure values are JSON-serializable (e.g., no functions, undefined, or circular references).
Use `has(key)` to check existence before calling `get` if you need to distinguish between missing and null.
Call `storage.session.clear()` to clear sessionStorage.
To get all sessionStorage items, you must use the native sessionStorage API or iterate manually.
Use `import storage from 'good-storage'` then call `storage.set(...)`.
Check browser settings or use a try-catch block to fallback gracefully.
Ensure the code runs in a browser, or check if `typeof window !== 'undefined'` before using the library.
Use default import: `import storage from 'good-storage'`.
No dependency data recorded yet.