# gulp-art-tpl

> A gulp plugin for art-template. 解析 art-template 模板引擎语法的gulp插件.

Latest version **1.3.1** (published 2023-07-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-art-tpl
pnpm add gulp-art-tpl
yarn add gulp-art-tpl
bun add gulp-art-tpl
```

## 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.3.1 |
| Published | 2023-07-20 |
| First published | 2018-06-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.4 |
| Dependencies | 3 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Mervin |
| Maintainers | mengqing723 |
| Keywords | gulp, art-template, template, artTemplate, template-engine, html-template, html |

## Links

- npm: https://www.npmjs.com/package/gulp-art-tpl
- Repository: https://github.com/mengqing723/gulp-art-tpl
- Homepage: https://github.com/mengqing723/gulp-art-tpl#readme
- Issues: https://github.com/mengqing723/gulp-art-tpl/issues
- npm.io page: https://npm.io/package/gulp-art-tpl

## Dependencies (3)

- [through2](https://npm.io/package/through2.md) ^4.0.2
- [art-template](https://npm.io/package/art-template.md) ^4.13.2
- [plugin-error](https://npm.io/package/plugin-error.md) ^2.0.1

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.3.1 (latest) — 2023-07-20
- 1.3.0 — 2023-07-09
- 1.2.0 — 2019-12-23
- 1.1.1 — 2018-06-13
- 1.0.0 — 2018-06-11

## README

# gulp-art-tpl

> A gulp plugin for art-template.

用于解析 `art-template` 模板引擎语法的gulp插件。它能让你快速在 Gulp 工作流中处理 art-template 文件。 


## Install

```
npm install --save-dev gulp-art-tpl
```



## Usage

👉 [查看 art-template 语法>>](https://aui.github.io/art-template/)

```js
const gulp = require('gulp')
const template = require('gulp-art-tpl')
const rename = require('gulp-rename')

gulp.task('build:html', function() {
  gulp.src('./src/*.{art,html,ejs}')
    .pipe(template({
      title: 'art-template',
      author: 'Mervin'
    }))
    .pipe(rename({
      extname: '.html'
    }))
    .pipe(gulp.dest('dist/'))
})
```

```html
<!-- demo.html -->
<div>
  <h1>{{title}}</h1>
  <p>{{author}}</p>
</div>

<!-- or -->
<div>
  <h1><%= title %></h1>
  <p><%= author%></p>
</div>
```

Output:

```html
<div>
  <h1>art template</h1>
  <p>Mervin</p>
</div>
```


> 1. `art-template` 同时支持标准语法和原始语法;
> 2. 原始语法兼容 `EJS` , `LoDash` 模板。

## API

```
template(data, options)
```
### data
需要渲染的数据
- `type` - `object`

### options
编译选项，具体查看 [template.defaults](https://aui.github.io/art-template/zh-cn/docs/options.html)
- `type` - `object`

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