# txx-tools

> 提供了格式化时间,HTMLEscape的功能

Latest version **1.0.1** (published 2022-12-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install txx-tools
pnpm add txx-tools
yarn add txx-tools
bun add txx-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.1 |
| Published | 2022-12-28 |
| First published | 2022-12-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | xingtang |
| Keywords | txx, txx-tools, tools |

## Links

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

## Recent versions

- 1.0.1 (latest) — 2022-12-28

## README

## 安装

```
npm i txx-tools

```

## 导入

```js
const itheima = require('txx-tools')

```

## 格式化时间

```js
// 调用dataFormat对时间进行格式化
const dtStr = itheima.dataFormat(new Date());
// 结果 2022-12-23 10:06:26
console.log(daStr);

```

## 转义HTML中特殊字符

```js
// 待转义HTML字符串
const htmlStr = '<h1 title="abc">这是h1标签<span>123R&nbsp;</span></h1>';
// 调用htmlEscape方法
const str = itheima.htmlEscape(htmlStr);
// 输出结果
console.log(str);

```

## 还原HTML中的特殊字符

```js
// 待转义HTML字符串
const str2 = itheima.htmlUnEscape(str);
// 输出结果
console.log(str2);

```

## 开源协议
ISC

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