# @wanghaofeng/tools

> 一个有一些神奇工具函数的个人工具集

Latest version **0.0.11** (published 2023-02-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install @wanghaofeng/tools
pnpm add @wanghaofeng/tools
yarn add @wanghaofeng/tools
bun add @wanghaofeng/tools
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.11 |
| Published | 2023-02-15 |
| First published | 2023-02-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | wanghaofeng |
| Maintainers | wanghaofeng |
| Keywords | tools |

## Links

- npm: https://www.npmjs.com/package/@wanghaofeng/tools
- Repository: https://github.com/WHF293/whf-tools
- Homepage: https://github.com/WHF293/whf-tools#readme
- Issues: https://github.com/WHF293/whf-tools/issues
- npm.io page: https://npm.io/package/@wanghaofeng/tools

## Recent versions

- 0.0.11 (latest) — 2023-02-15
- 0.0.10 — 2023-02-15
- 0.0.9 — 2023-02-15
- 0.0.8 — 2023-02-11
- 0.0.7 — 2023-02-11
- 0.0.6 — 2023-02-11
- 0.0.4 — 2023-02-11
- 0.0.3 — 2023-02-11
- 0.0.2 — 2023-02-11
- 0.0.1 — 2023-02-11

## README

<!--
 * @Author: hfWang
 * @Date: 2023-02-11 02:54:18
 * @LastEditTime: 2023-02-11 14:13:12
 * @Description: file content
 * @FilePath: \whf-tools\readme.md
-->
## 安装

```shell
pnpm add @wanghaofeng/tools
# or
yarn add @wanghaofeng/tools
```

## 使用

### to 函数

```ts
// demo.ts
import { to } from '@wanghaofeng/tools'

const fetchSomething = asyncc () => {
    const [err, res] = await to(fetch('xxxx'))
    return res?.json()
}
```

### storage

```ts
import { storage } from "@wanghaofeng/tools";

storage.setLs("test", { a: 1, b: 2 });
storage.getLs("test");
storage.delLs("test");
```

### systemUpdate

-   vue 项目使用

```html
<!-- App.vue -->
<template>
   <!-- ........... -->
</template>
<script setup lang="ts">
import { SystemUpdate } from '@wanghaofeng/tools'
import { onMounted, onUnMounted, ref } from 'vue'
import { ElMessage } from 'element-plus'

const su = ref<SystemUpdate>(null)

onMounted(() => {
  su.value = new SystemUpdate(30)
  su.value.on(() => {
    ElMessage({
      message: '系统有更新，请重新清理下浏览器缓存，重新加载页面',
      type: 'warning',
    })
  })
)

onUnMounted(() => {
  su.value.destroy()
})
</script>
```








git config --global http.sslVerify false
git config --global --unset https.proxy
git config --global --unset http.proxy

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