# utils-steven

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

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

## Install

```sh
npm install utils-steven
pnpm add utils-steven
yarn add utils-steven
bun add utils-steven
```

## 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-09 |
| First published | 2022-07-09 |
| 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 | danyawa |
| Keywords | steven, formatDate, HTMLEscape |

## Links

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

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2022-07-09

## README

## 安装
```
npm install steven
```


## 导入
```js
const steven = require('./utils-steven')
```

## 格式化事件
```js
//调用
const dtStr = steven.dateFormat(new Date())
//结果2022-07-09 09:41:02
console.log(dtStr);
```

## 转义HTML
```js
// 带转换的HTML字符串
const htmlStr = '<h1 title="abc">这是h1标签<span>123&nbsp;</span></h1>'
//调用htmlEscape转换
const str = my.htmlEscape(htmlStr)
//结果 &lt;h1 title=&quot;abc&quot;&gt;这是h1标签&lt;span&gt;123&amp;nbsp;&lt;/span&gt;&lt;/h1&gt;
console.log(str)
```

## 还原HTML中特殊字符
```js
const str2 = my.htmlUnEscape(str)
console.log(str2)
//结果<h1 title="abc">这是h1标签<span>123&nbsp;</span></h1>
```

### 开源协议
ISC

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