# itheima-tools-qianxi

> 提供格式化时间，HEMLEscape(特殊字符转义)相关功能

Latest version **1.0.0** (published 2022-07-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install itheima-tools-qianxi
pnpm add itheima-tools-qianxi
yarn add itheima-tools-qianxi
bun add itheima-tools-qianxi
```

## 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.0 |
| Published | 2022-07-30 |
| First published | 2022-07-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | qianxi2112 |
| Keywords | itheima, escape, date |

## Links

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

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2022-07-30

## README

<!--
自己开发包里包的说明文档。这里使用的是Markdown 语法 
-->
<!-- ##为二级标题 -->
##安装
```
npm install itheima-tools-qianxi
```

##导入
```js
const itheima=require('itheima-tools-qianxi')
```

##格式化时间
```js
// 调用dataFormat对时间初始化
const datestr = itheima.dataFormat(new Date())
// 结果：2022-07-30 12:28:15
console.log(datestr);
```

##转义html中的特殊字符
```js
// 待转义的html字符串
const htmlstr = '<h1 title="abc">这是一个h1标签</h1>'
// 调用htmlEscape进行转换
const str1 = itheima.htmlEscape(htmlstr)
// 结果：&lt;h1 title=&quot;abc&quot;&gt;这是一个h1标签&lt;/h1&gt;
console.log(str1);
```

##还原html中的特殊字符
```js
// 调用htmlUnEscape进行转换
const str2 = itheima.htmlUnEscape(str1)
// 结果：<h1 title="abc">这是一个h1标签</h1>
console.log(str2);
```

##开源协议
ISC

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