# beauty.js

> make web beauty

Latest version **0.2.1** (published 2020-07-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install beauty.js
pnpm add beauty.js
yarn add beauty.js
bun add beauty.js
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2020-07-29 |
| First published | 2017-11-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 112.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | alexayan |
| Maintainers | alexayan |

## Links

- npm: https://www.npmjs.com/package/beauty.js
- Repository: https://github.com/alexayan/beauty.js
- Homepage: https://github.com/alexayan/beauty.js#readme
- Issues: https://github.com/alexayan/beauty.js/issues
- npm.io page: https://npm.io/package/beauty.js

## Dependencies (2)

- [sane](https://npm.io/package/sane.md) ^2.2.0
- [pangu](https://npm.io/package/pangu.md) ^3.3.0

## Recent versions

- 0.2.1 (latest) — 2020-07-29
- 0.2.0 — 2020-06-24
- 0.1.5 — 2020-05-16
- 0.1.4 — 2020-05-14
- 0.1.3 — 2020-05-14
- 0.1.2 — 2020-05-12
- 0.1.1 — 2017-12-06
- 0.1.0 — 2017-11-27

## README

# beauty.js

![Build Status](https://img.shields.io/travis/alexayan/beauty.js.svg)
![Coverage](https://img.shields.io/coveralls/alexayan/beauty.js.svg)
![Downloads](https://img.shields.io/npm/dm/beauty.js.svg)
![Downloads](https://img.shields.io/npm/dt/beauty.js.svg)
![npm version](https://img.shields.io/npm/v/beauty.js.svg)
![dependencies](https://img.shields.io/david/alexayan/beauty.js.svg)
![dev dependencies](https://img.shields.io/david/dev/alexayan/beauty.js.svg)
![License](https://img.shields.io/npm/l/beauty.js.svg)

Make the web more beautiful

## Use it with NPM

Install it via npm:

```shell
npm install beauty.js
```

And include in your project:

```javascript
import beautyJS from 'beauty.js';

// default usage
beautyJS.beauty('text')
beautyJS.beauty(Element)

// custom usage of TextFormat
const format = new beautyJS.TextFormat({
  nouns: ['Apple', 'IOS']
});
format.updateNouns(['Apple', 'IOS', 'Android'])
format.formatText('text')
// all tags must closed like: <tag /> or <tag></tag>
format.formatHTMLText('<p><image src="url"/>text</p>')
// all tags must closed like: <tag></tag> and no nest
format.formatHTML('<span>text</span><span>another text</span>')

// custom usage of ParagraphFormat
const p = new beautyJS.ParagraphFormat(Element, {
    disableHanging: true, // 取消标点悬挂
    format: new beautyJS.TextFormat(), // 文本格式化
    disableFormat: true, // 禁用文本格式化
    clamp: 3,// 最多显示行数
    strict: false // 是否开启严格排版模式，默认关闭。开启后会移除【】中的内容，"" “” 替换为 「」，以「」开头，直接去掉符号，• 替换为 ·
})
// clamp
p.clamp(10) //设置展开行数

// remember destroy to avoid memory leaks
p.clear()
```

## Use it with Script Link

```javascript
<head>
  // Files are located on /node_modules/beauty.js/build/
  <script src="beauty.min.js"></script>
</head>
<script>
  beautyJS.beauty('text')
  ...
</script>
```

## License

MIT

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