# joe-tools

> 时间格式化、HTMLEscape 相关功能

Latest version **1.0.1** (published 2023-03-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install joe-tools
pnpm add joe-tools
yarn add joe-tools
bun add joe-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 | 2023-03-08 |
| First published | 2022-08-31 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | qiaofugui |
| Keywords | joe, dataFormat, escape |

## Links

- npm: https://www.npmjs.com/package/joe-tools
- npm.io page: https://npm.io/package/joe-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.1 (latest) — 2023-03-08
- 1.0.0 — 2022-08-31

## README

<!-- 包的说明文档 -->

# 安装方式

```node
nmp install joe-tools
```

# 导入方式

```javascript
const joe = require('joe-tools');
```

# 格式化时间

```javascript
// 调用 dateFormat 对时间进行格式化
const dtStr = joe.dateFormat(new Date());
// 输出的结果 2050年 01月 01号   23:00:00
console.log(dtStr);
```

# 转义 HTML 中特殊字符

```javascript
// 待转换的 HTML 字符串
const htmlStr = '<h1 style="color:red;">h1标签 <span>&nbsp;666</span></h1>';
// 调用 htmlEscape 方法进行转换
const str = joe.htmlEscape(htmlStr);
// 输出的结果 &lt;h1 style=&quot;color:red;&quot;&gt;h1标签 &lt;span&gt;&amp;nbsp;666&lt;/span&gt;&lt;/h1&gt;
console.log(str);
```

# 还原 HTML 中特殊字符

```javascript
// 待还原的 HTML 字符串
const str = '&lt;h1 style=&quot;color:red;&quot;&gt;h1标签 &lt;span&gt;&amp;nbsp;666&lt;/span&gt;&lt;/h1&gt;';
// 调用 htmlUnEscape 方法进行转换
const str1 = joe.htmlEscape(htmlStr);
// 输出的结果 <h1 style="color:red;">h1标签 <span>&nbsp;666</span></h1>
console.log(str);
```

# 开源协议

ISC

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