# package-firstest

> 时间格式化,htmlEscape相关功能

Latest version **1.0.0** (published 2022-12-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install package-firstest
pnpm add package-firstest
yarn add package-firstest
bun add package-firstest
```

## 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-12-15 |
| First published | 2022-12-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | wittytang |
| Keywords | myself, testPackage, timeTranslate |

## Links

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

## Alternatives

- [ext-list](https://npm.io/package/ext-list.md) — 6.3M weekly downloads
- [@lexical/selection](https://npm.io/package/@lexical/selection.md) — 3.8M weekly downloads
- [@lexical/text](https://npm.io/package/@lexical/text.md) — 3.6M weekly downloads
- [@lexical/clipboard](https://npm.io/package/@lexical/clipboard.md) — 3.0M weekly downloads
- [@tiptap/extension-mention](https://npm.io/package/@tiptap/extension-mention.md) — 3.0M weekly downloads

## Recent versions

- 1.0.0 (latest) — 2022-12-15

## README

## 安装

```
npm install package-firstest
```

## 导入

```js
const firstTest = require("package-firstest");
```

## 格式化时间

```js
// 调用dateFormat 对时间进行格式化
const dtStr = firstTest.dateFormat(new Date());
console.log(dtStr);
// 结果 2022-12-15 11:05:20
```

## 转义|还原 html 特殊字符

```js
// 待转换的html字符串
const htmlstr = '<h1 title="abc">这是h1标签<span>123&nbsp;</span></h1>';
// 调用htmlEscape方法进行转换
const str = firstTest.htmlEscape(htmlstr);
// 转换结果 &lt;h1 title=&quot;abc&quot;&gt;这是h1标签&lt;span&gt;123&amp;nbsp;&lt;/span&gt;&lt;/h1&gt;

// 调用htmlUnEscape方法进行转换
const str2 = firstTest.htmlEscape(str);
// 转换结果 <h1 title="abc">这是h1标签<span>123&nbsp;</span></h1>
```

## 开源协议

ISC

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