# @likg/storage

> Storage APIs

Latest version **1.0.2** (published 2025-07-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install @likg/storage
pnpm add @likg/storage
yarn add @likg/storage
bun add @likg/storage
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2025-07-24 |
| First published | 2023-08-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | lee |
| Maintainers | lihongyao |
| Keywords | Storage, 本地存储 |

## Links

- npm: https://www.npmjs.com/package/@likg/storage
- Repository: https://github.com/lihongyao/js-libs
- Homepage: https://github.com/lihongyao/js-libs/tree/main/packages/storage
- Issues: https://github.com/lihongyao/js-libs/issues
- npm.io page: https://npm.io/package/@likg/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

- 1.0.2 (latest) — 2025-07-24
- 1.0.1 — 2023-08-17

## README

# 概述

为了方便对JSAPI LocalStorage的使用，这里封装lg-storage库简化操作。

```shell
# 安装
$ npm install @likg/storage
$ yarn add @likg/storage
$ pnpm add @likg/storage
```

# API

```typescript
/**
 * 存储数据
 * @param key 键
 * @param value 值
 */
static set(key: string, value: any): void;
/**
 * 读取数据
 * @param key 键
 * @returns
 */
static get<T = any>(key: string): T | null;
/**
 * 移除数据
 * key的类型可以为字符串、字符串数组以及undefined
 * 根据不同类型，有如下三种结果：
 * - 当key为字符串时/移除指定key对应的数据
 * - 当key为字符串数组时/遍历删除指定key对应的数据
 * - 当key为undefined时/清空所有本地数据
 * @param key
 */
static del(key?: string | string[]): void;
```

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