## 此文件为包使用说明文档

## 安装

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