# lh-tools

> lh提供了格式化时间、HTMLEscape相关的功能

Latest version **1.0.2** (published 2022-03-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install lh-tools
pnpm add lh-tools
yarn add lh-tools
bun add lh-tools
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-03-05 |
| First published | 2022-03-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | spectre0725 |
| Keywords | lh, 0725, dataFormat, itheima |

## Links

- npm: https://www.npmjs.com/package/lh-tools
- npm.io page: https://npm.io/package/lh-tools

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2022-03-05
- 1.0.1 — 2022-03-05

## README

## 此文件为包使用说明文档

## 安装

npm i lh-tools

## 导入
```js
const lhtools=require('lh-tools');
```

## 格式化时间
```js
//调用 dateFormat对时间进行格式化
const dtStr = lhtools.dateFormat(new Date());
console.log(dtStr);
// 结果 2022-03-06 17:06:55
```

## 转义html中特殊字符
```js
//定义待转换的字符串
const htmlStr = '<h1 title="abc">这是h1标签<span>123&nbsp;</span></h1>'
//调用HTMLEscape方法进行转换
const newhtmlStr = lhtools.HTMLEscape(htmlStr);
console.log(newhtmlStr);
//结果 &lt;h1 title=&quot;abc&quot;&gt;这是h1标签&lt;span&gt;123&amp;nbsp;&lt;/span&gt;&lt;/h1&gt;
```

## 还原html中特殊字符
```js
//待还原度HTML字符串
const newhtmlStr2 = lhtools.HTMLUnEscape(newhtmlStr);
console.log(newhtmlStr2);
//结果 <h1 title="abc">这是h1标签<span>123&nbsp;</span></h1>
```

## 开源协议
ISC

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