# sailfish-template-analyzer

> 旗鱼前端模板语法解析工具

Latest version **1.0.0** (published 2021-06-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install sailfish-template-analyzer
pnpm add sailfish-template-analyzer
yarn add sailfish-template-analyzer
bun add sailfish-template-analyzer
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-06-07 |
| First published | 2021-06-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | yangbo |
| Maintainers | yangbo199315 |

## Links

- npm: https://www.npmjs.com/package/sailfish-template-analyzer
- npm.io page: https://npm.io/package/sailfish-template-analyzer

## Recent versions

- 1.0.0 (latest) — 2021-06-07

## README

## sailfish-template-analyzer

#### 简介
 
模板语法解析器，可以自定义你的模板字符串，并通过此依赖包来解析，最终生成结果

#### 使用示例

```
npm install sailfish-template-analyzer
```

```
import TemplateAnalyzer from 'sailfish-template-analyzer';

let templateAnalyzer = new TemplateAnalyzer('{{c.e}} + {{a}} + {{b}} === 5', '{{', '}}')
console.log(templateAnalyzer.result({
  a: 1,
  b: 2,
  c: {
    e: 2
  }
}));
```

#### 参数说明

##### 实例参数

let templateAnalyzer = new TemplateAnalyzer(sourceStr, start, end)

- sourceStr: 源字符串(带有模板字符的字符串)
- start: 用于定义你的模板的开始字符(默认'{{')
- end: 用于定义你的模板的结束字符(默认'}}')

##### 方法参数

templateAnalyzer.result(dataModel)

- dataModel: 数据模型(会从此数据模型中查找模板字符对应的数据)

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