# cjh_tools

> 提供了格式化时间、HTMLEScape（html字符转义）相关的功能

Latest version **1.0.0** (published 2023-02-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install cjh_tools
pnpm add cjh_tools
yarn add cjh_tools
bun add cjh_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.0 |
| Published | 2023-02-17 |
| First published | 2023-02-17 |
| 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 | cjh_utils |
| Keywords | Data, caojunhao, cjh, dateFormat, escape |

## Links

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

## Alternatives

- [@libsql/sqlite3](https://npm.io/package/@libsql/sqlite3.md) — 39.8K weekly downloads
- [@fortemi/core](https://npm.io/package/@fortemi/core.md) — 461 weekly downloads
- [cdb-converter](https://npm.io/package/cdb-converter.md) — 341 weekly downloads
- [@uplo/adapter-prisma](https://npm.io/package/@uplo/adapter-prisma.md) — 75 weekly downloads
- [typeorm-aios](https://npm.io/package/typeorm-aios.md) — 30 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2023-02-17

## README

## 安装
```
npm install cjh_tools
```

## 导入
``` js
const cjh_tools = require('cjh_tools')
```

## 格式化时间
```js
// 调用dateFormat 对时间进行格式化
const dtStr = cjh_tools.dataFormat(new Date())
// 结果 2023-2-17 12:00:00
console.log(dtStr)
```

## 转义HTML中的特殊字符
```js
// 待转换的HTML字符串
const html = '<h1 style="color:red">123123</h1>'
// 调用htmlEscape方法进行转换
let htmlstr = cjh_tools.htmlEscape(html)
// 转换结果 &lth1 style=&quotcolor:red&quot&gt123123&lt/h1&gt
console.log(htmlstr)
```

## 还原HTML中的特殊字符
```js
// 待转换的HTML字符串
const html = '<h1 style="color:red">123123</h1>'
// 调用htmlEscape方法进行转换
const htmlstr = cjh_tools.htmlEscape(html)
// 调用htmlUnEscape方法进行还原
const html = cjh_tools.htmlUnEscape(htmlstr)
// 输出结果 <h1 style="color:red">123123</h1>
console.log(htmlstr);

```

## 开源协议
ISC

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