1.0.0 • Published 4 years ago

zh-template-compiler v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

zh-template-compiler

中文模板编译器,一个 pegjs 的玩具 💥

✨ Installation

npm install zh-template-compiler

or

yarn add zh-template-compiler

🔥 Example

const { parse } = require('zh-template-compiler')

const ast = parse(`<组件 属性="值"></组件>`)

console.log(ast)
// {
//    "type": "component",
//    "name": "组件",
//    "attrs": [
//       {
//          "isBind": false,
//          "key": "属性",
//          "value": "值"
//       }
//    ],
//    "children": []
// }