# gulp-velocityjs2

> Gulp compile plugin for velocity(http://velocity.apache.org/) template

Latest version **0.1.0** (published 2019-07-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-velocityjs2
pnpm add gulp-velocityjs2
yarn add gulp-velocityjs2
bun add gulp-velocityjs2
```

## 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.0 |
| Published | 2019-07-15 |
| First published | 2018-05-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | skt-t1-byungi |
| Maintainers | skt-t1-byungi |
| Keywords | velocityjs, velocity, gulp, vtl, template |

## Links

- npm: https://www.npmjs.com/package/gulp-velocityjs2
- Repository: https://github.com/skt-t1-byungi/gulp-velocityjs2
- npm.io page: https://npm.io/package/gulp-velocityjs2

## Dependencies (6)

- [through2](https://npm.io/package/through2.md) ^3.0.1
- [velocityjs](https://npm.io/package/velocityjs.md) ^1.1.3
- [replace-ext](https://npm.io/package/replace-ext.md) ^1.0.0
- [import-fresh](https://npm.io/package/import-fresh.md) ^3.1.0
- [plugin-error](https://npm.io/package/plugin-error.md) ^1.0.1
- [resolve-from](https://npm.io/package/resolve-from.md) ^5.0.0

## Recent versions

- 0.1.0 (latest) — 2019-07-15
- 0.0.12 — 2019-06-09
- 0.0.11 — 2018-05-31
- 0.0.10 — 2018-05-31
- 0.0.9 — 2018-05-31
- 0.0.8 — 2018-05-31
- 0.0.7 — 2018-05-31
- 0.0.6 — 2018-05-31
- 0.0.5 — 2018-05-31
- 0.0.4 — 2018-05-31
- 0.0.3 — 2018-05-31
- 0.0.2 — 2018-05-31
- 0.0.1 — 2018-05-31
- 0.0.0 — 2018-05-31

## README

# gulp-velocityjs2
Gulp compile plugin for velocity(http://velocity.apache.org/) template.

[![npm](https://img.shields.io/npm/v/gulp-velocityjs2.svg?style=flat-square)](https://www.npmjs.com/package/gulp-velocityjs2)
[![npm](https://img.shields.io/npm/dt/gulp-velocityjs2.svg?style=flat-square)](https://www.npmjs.com/package/gulp-velocityjs2)

## Install
```sh
yarn add gulp-velocityjs2
```

## Usage
### Basic
```js
const gulp = require('gulp');
const gulpVTL = require('gulp-velocityjs2');

gulp.task('build', ()=>{
  return gulp.src('./index.vm')
    .pipe( gulpVTL() )
    .pipe(gulp.dest('./build'));
});
```

### Variable
```html
<div>hello $name</div>
```
```js
gulp.task('build', ()=>{
  return gulp.src('./hello.vm')
    .pipe( gulpVTL({ name: 'byungi' }) )
    .pipe(gulp.dest('./build'));
});
```
output:
```html
<div>hello byungi</div>
```

## API
### gulpVTL([data[, options]])
Returns gulp transformer for velocity compilation.

#### data
Set the data values.

##### object
```js
gulp.src('index.vm')
    .pipe(gulpVTL({var1: 'value1', var2: 'value2'}))
```

##### file
```js
gulp.src('index.vm')
    .pipe(gulpVTL('./data.json'))
```

##### directory
If it is a `directory`, set the data that matches the file name in the directory.

```js
gulp.src('view/*.vm')
  .pipe( gulpVTL('data/') )
```
`view/main.vm`
```
hello $value
```
`data/main.js`
```js
export.value = 'world'
```
output:
```html
hello world
```

#### options
##### Compile options
details https://github.com/shepherdwind/velocity.js

- `escape`
- `unescape`
- `env`
- `blocks`
- `ignorespace`
- `macros`

##### Other options
###### ext
Output extension name. Default is html

###### refresh
If this value is true, import new data from the path without cache. This is useful when in watch mode. Default is false.


## Related
- [shepherdwind/velocity.js](https://github.com/shepherdwind/velocity.js)
- http://velocity.apache.org

## License
MIT

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