# template-lite.js

> 微型的 javascript 模版引擎, 仅仅 1kb, 有时候我们只需要一个 string 替换, 但是又不想使用那么庞大的 template, 那么它就是你正在寻找的。

Latest version **1.0.0** (published 2016-09-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install template-lite.js
pnpm add template-lite.js
yarn add template-lite.js
bun add template-lite.js
```

## 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 | 2016-09-23 |
| First published | 2016-09-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | gongchao |
| Maintainers | gongchao |

## Links

- npm: https://www.npmjs.com/package/template-lite.js
- Repository: https://gongchao@github.com/gongchao/template-lite.js
- Homepage: https://github.com/gongchao/template-lite.js#readme
- Issues: https://github.com/gongchao/template-lite.js/issues
- npm.io page: https://npm.io/package/template-lite.js

## Dependencies (1)

- [babel-preset-es2015](https://npm.io/package/babel-preset-es2015.md) ^6.14.0

## Recent versions

- 1.0.0 (latest) — 2016-09-23

## README

# template-lite.js
微型的 javascript 模版引擎, 仅仅 1kb, 有时候我们只需要一个 string 替换, 但是又不想使用那么庞大的 template, 那么它就是你正在寻找的。

## 使用方法

### 引入 template-lite.js
```javascript
<script src="./dist/template-lite-compiled.js"></script>
```

### 使用
```javascript
    var result = template(
            document.getElementById('main').innerHTML
            , {
                hello: 'template-lite.js',
                description: '这是一个微型的 javascript 模版引擎, 它仅仅 1kb, 当然也没任何额外的功能, 仅仅作为模版替换, 支持 function 传入。'
            });
    document.body.insertAdjacentHTML('afterbegin', result);
```

支持 函数 引入
```javascript
    {
        hello: 'hello world',
        description: function () {
            return 'template-lite.js'
        }
    }
```

So easy!

## License
template-lite.js is released under the MIT license.

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