# @leejim/wxml-parser

> 微信小程序WXML Parser

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

## Install

```sh
npm install @leejim/wxml-parser
pnpm add @leejim/wxml-parser
yarn add @leejim/wxml-parser
bun add @leejim/wxml-parser
```

## 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.0 |
| Published | 2022-07-09 |
| First published | 2020-01-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 14 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | leejim |
| Maintainers | leejim |
| Keywords | wxml, parse, wechat, leejim |

## Links

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

## 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.2.0 (latest) — 2022-07-09
- 0.1.6 — 2022-05-06
- 0.1.5 — 2022-02-28
- 0.1.4 — 2022-02-21
- 0.1.3 — 2022-02-21
- 0.1.2 — 2022-01-05
- 0.1.1 — 2020-01-21
- 0.1.0 — 2020-01-16

## README

<p align="center">
    <img width="512" src="https://user-images.githubusercontent.com/7017290/148170109-70f1b3e4-1bd6-41f4-b1e7-c5e11dae3656.png" />
</p>
<p align="center">
    <a href="https://www.npmjs.com/package/@leejim/wxml-parser"><img alt="npm" src="https://img.shields.io/npm/v/@leejim/wxml-parser"></a>
    <a href="https://www.npmjs.com/package/@leejim/wxml-parser"><img alt="npm" src="https://img.shields.io/npm/dw/@leejim/wxml-parser"></a>
    <a href="https://www.npmjs.com/package/@leejim/wxml-parser"><img alt="NPM" src="https://img.shields.io/npm/l/@leejim/wxml-parser"></a>
</p>

## wxml-parser

微信小程序 WXML Parser

## 安装

```bash
npm install -D @leejim/wxml-parser
```

## 使用

```js
var WXMLParser = require('@leejim/wxml-parser');
var parser = new WXMLParser({
    onopentag(tagname, attrs, isSelfClosing) {},

    onclosetag(tagname) {},

    ontext(text) {},

    oncomment(cmt) {},

    ontemplate(tmp) {}
});
parser.write('<view>test</view>');
```

## 参数

### onopentag

参数名|数据类型|描述
--|--|--
tagname | `string` | 标签名
attrs | `Array<string|AttrEntity>; interface AttrEntity { key: string; value: string } ` | 单值时只返回 `key`；否则返回 `key`` 和 `value`
isSelfClosing | `boolean` | 是否自闭合标签

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