Skip to content

StorageManager.js

A convenient and feature‑rich interface for localStorage/sessionStorage, offering expiration, compression, batch operations, and events.

Automatic Expiration

Set items to expire automatically after a specified duration. Expired items are cleaned up automatically.

Batch Operations

Perform batch set, get, and remove operations efficiently for multiple items at once.

Optional Compression

Optionally compress stored data using LZString to save space and optimize storage.

Cross-Tab Events

Listen for changes to specific storage keys across tabs and windows in real-time.

Namespacing

Supports namespacing to avoid key collisions between different parts of your application.

Type-Safe

Automatically handles JSON serialization/deserialization with proper error handling.

StorageManager.js simplifies working with browser storage by providing a consistent, feature-rich API that handles common tasks like expiration, compression, and event listening—all while maintaining a small footprint and zero dependencies (except optional LZString for compression).

Whether you’re building a simple web app or a complex application with multiple tabs, StorageManager.js has you covered.