open-index/open-npm huggingface dataset:
npm package: @lunaverge/local-storage-manager
Description: A localStorage management utility with event subscription support
Author: lunaverge
Latest version: 1.0.0

# local-storage-manager

Local storage manager, supports event subscription, simplifies local storage operations. Supports React and Vue.

## 安装

```bash
npm install @lunaverge/local-storage-manager
```

## 使用示例

```ts
import { LocalStorageManager } from "@lunaverge/local-storage-manager";

const storage = LocalStorageManager.getInstance();

storage.setItem("user", { name: "Alice" });
const user = storage.getItem<{ name: string }>("user");
console.log(user);
```

## API

- `getInstance()`
- `setItem(key, value)`
- `getItem(key)`
- `removeItem(key)`
- `subscribe(key, callback)`
- `unsubscribe(key, callback)`