# @gulibs/react-storage

> > 带过期时间的本地存储

Latest version **0.0.8** (published 2025-06-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @gulibs/react-storage
pnpm add @gulibs/react-storage
yarn add @gulibs/react-storage
bun add @gulibs/react-storage
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2025-06-18 |
| First published | 2023-02-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 10 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | gujiwen |
| Keywords | storage, react storage |

## Links

- npm: https://www.npmjs.com/package/@gulibs/react-storage
- Repository: https://github.com/AnizGu/react-storage
- Homepage: https://github.com/AnizGu/react-storage#readme
- Issues: https://github.com/AnizGu/react-storage/issues
- npm.io page: https://npm.io/package/@gulibs/react-storage

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 0.0.8 (latest) — 2025-06-18
- 0.0.7 — 2025-06-18
- 0.0.6 — 2025-06-10
- 0.0.5 — 2023-02-12

## README

# React Stroage
> 带过期时间的本地存储

[![NPM](https://img.shields.io/npm/v/@gulibs/react-storage.svg)](https://www.npmjs.com/package/react-storage)

## 安装

```bash
npm install --save @gulibs/react-storage
```

**or**

```bash
yarn add @gulibs/react-storage
```
### 使用

```typescript
import { ReactStorage } from '@gulibs/react-storage';

const App: React.FC = ()=> {

    const storage = ReactStorage.getInstance();

    useEffect(()=> {
        storage.type = 'sessionStorage';
        storage.type = 'localStorage';
        storage.set('hello', '你好');
        console.log('get', storage.get('hello'));
        console.log("getKeys", storage.getKeys());
        storage.remove('test');
        storage.removeExpired();
        storage.removeAll();
    }, []);
    ...
}
```

---
_Source: https://npm.io/package/@gulibs/react-storage · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
