# hp123

> 针对html标签的转义

Latest version **1.0.1** (published 2021-12-31) · ISC license · 0 weekly downloads

## Install

```sh
npm install hp123
pnpm add hp123
yarn add hp123
bun add hp123
```

## 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 | 2021-12-31 |
| First published | 2021-07-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | zhp |
| Maintainers | haipeng123 |

## Links

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

## Recent versions

- 1.0.1 (latest) — 2021-12-31
- 1.0.0 — 2021-07-11

## README

## 安装
```
npm install hp123
```
## 导入
```js
const zhp = require('hp123')
```
## 转义html标签特殊字符
```js
let str = '<meta name="viewport" content="width=device-width, initial-scale=1.0">'
let newStr = htmlEsc.htmlEscape(str)
console.log(newStr);
//结果: &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
```
## 还原html标签特殊字符
```js
let str = '<meta name="viewport" content="width=device-width, initial-scale=1.0">'
let newStr = htmlEsc.htmlUnEscape(str)
console.log(newStr)
//结果: <meta name="viewport" content="width=device-width, initial-scale=1.0">
```

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