https://github.com/wxmlfile/wxml-parser
A fast and tolerant wxml parser
https://github.com/wxmlfile/wxml-parser
wechat-mini-program wxml wxml-parser
Last synced: 10 months ago
JSON representation
A fast and tolerant wxml parser
- Host: GitHub
- URL: https://github.com/wxmlfile/wxml-parser
- Owner: wxmlfile
- License: mit
- Created: 2021-10-15T02:54:09.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-08-15T06:14:28.000Z (almost 2 years ago)
- Last Synced: 2024-09-30T09:26:33.888Z (almost 2 years ago)
- Topics: wechat-mini-program, wxml, wxml-parser
- Language: JavaScript
- Homepage: https://wxmlfile.github.io/explorer
- Size: 74.2 KB
- Stars: 28
- Watchers: 3
- Forks: 4
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
## @wxml/parser
[](https://www.npmjs.com/package/@wxml/parser)
[](https://github.com/wxmlfile/wxml-parser/actions/workflows/ci.yml?query=branch%3Amain)
[](https://opensource.org/licenses/MIT)
[](https://github.com/wxmlfile/wxml-parser/pulls)
[](https://twitter.com/chenleidev)
A fast and tolerant wxml parser
## Installation
```bash
## npm
$ npm install @wxml/parser --save-dev
## pnpm
$ pnpm add -D @wxml/parser
## yarn
$ yarn add @wxml/parser --dev
## cnpm (for china user)
$ cnpm install @wxml/parser --save-dev
```
## AST docs
Wanna try high level usage, check our [`AST` docs](https://github.com/wxmlfile/wxml-parser/blob/main/docs/ast.md) first !
## AST explorer (sxzz/ast-explorer)
## Basic Usage
```javascript
const { parse } = require("@wxml/parser");
const AST = parse(`
{{mallName}}
`);
console.log("AST structure: ", AST);
```
## Try Play Online
Open [RunKit](https://npm.runkit.com/%40wxml%2Fparser) , and then happy coding !