# formate.js

> Javascript template engine to format the output

Latest version **0.1.1** (published 2017-03-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install formate.js
pnpm add formate.js
yarn add formate.js
bun add formate.js
```

## 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.1.1 |
| Published | 2017-03-19 |
| First published | 2017-03-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | 李蔚生 |
| Maintainers | airquality |
| Keywords | template, engine, format |

## Links

- npm: https://www.npmjs.com/package/formate.js
- Repository: https://github.com/LeeWeisheng/formate.js
- Homepage: https://github.com/LeeWeisheng/formate.js#readme
- Issues: https://github.com/LeeWeisheng/formate.js/issues
- npm.io page: https://npm.io/package/formate.js

## Recent versions

- 0.1.1 (latest) — 2017-03-19
- 0.1.0 — 2017-03-19

## README

# formate.js

保留代码格式的 javascript 模版引擎

## 使用

有三种方式插入值：

- `{{! 1 + 1 }}` ：插入 js 表达式
- `{{- variable }}` ：转义变量
- `{{= variable }}` ：直接插值

使用方法：

```js
import { compile } from 'formate.js'

const template = `
测试段落
  {{= variable }}
测试段落
`

const data = {
  variable: '变量值'
}

const render = compile(template)
const result = render(data)

/* =>
测试段落
  变量值
测试段落
*/
```

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