# wxml-minifier

> 微信小程序WXML压缩工具

Latest version **0.0.7** (published 2022-07-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install wxml-minifier
pnpm add wxml-minifier
yarn add wxml-minifier
bun add wxml-minifier
```

## 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.0.7 |
| Published | 2022-07-09 |
| First published | 2020-01-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 158.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | leejimqiu |
| Maintainers | leejim |
| Keywords | minifier, wxml, 微信小程序, miniprogram, wechat |

## Links

- npm: https://www.npmjs.com/package/wxml-minifier
- Repository: https://github.com/LeeJim/wxml-minifier
- Homepage: https://github.com/LeeJim/wxml-minifier#readme
- Issues: https://github.com/LeeJim/wxml-minifier/issues
- npm.io page: https://npm.io/package/wxml-minifier

## Dependencies (1)

- [@leejim/wxml-parser](https://npm.io/package/@leejim/wxml-parser.md) ^0.2.0

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.0.7 (latest) — 2022-07-09
- 0.0.6 — 2022-05-07
- 0.0.5 — 2022-05-07
- 0.0.4 — 2022-05-06
- 0.0.3 — 2022-01-09
- 0.0.2 — 2022-01-09
- 0.0.1 — 2020-01-21

## README

![image](https://user-images.githubusercontent.com/7017290/147433768-424237a5-b136-4cc1-9ea0-e11722fc732b.png)

<p align="center">
    <a href="https://www.npmjs.com/package/wxml-minifier"><img alt="npm" src="https://img.shields.io/npm/v/wxml-minifier"></a>
    <a href="https://www.npmjs.com/package/wxml-minifier"><img alt="npm" src="https://img.shields.io/npm/dm/wxml-minifier"></a>
    <a href="https://www.npmjs.com/package/wxml-minifier"><img alt="NPM" src="https://img.shields.io/npm/l/wxml-minifier"></a>
    <a><img alt="coverage" src="./coverage/badge-lines.svg"></a>
</p>

# wxml-minifier

微信小程序 WXML 压缩工具

## 安装

```bash
npm i -D wxml-minifier
```

## 使用

minifier(resource[, options])

### 基础使用

```js
const minifier = require('wxml-minifier')
const wxmlStr = `
<view class="home"         >
<!-- test -->
</view>
`
const minified = minifier(wxmlStr)

console.log(minified) // <view class="home></view>
```

## 选项

 名称 | 类型 | 默认值 | 功能
 :-- | :-- | :-- | :--
whitespace | `Boolean` | `true` | 移除 wxml 多余的空格
comment | `Boolean` | `true` | 移除所有的注释

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