# @yodasws/gulp-file-includer

> A file include plugin for gulp

Latest version **1.1.1** (published 2018-09-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @yodasws/gulp-file-includer
pnpm add @yodasws/gulp-file-includer
yarn add @yodasws/gulp-file-includer
bun add @yodasws/gulp-file-includer
```

## 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.1.1 |
| Published | 2018-09-03 |
| First published | 2018-09-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10 |
| Dependencies | 4 |
| Unpacked size | 94.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | yodasws |
| Keywords | gulpplugin, file, includer, include, inject, gulp, plugin |

## Links

- npm: https://www.npmjs.com/package/@yodasws/gulp-file-includer
- Repository: https://github.com/YodasWs/gulp-file-includer
- Homepage: https://github.com/YodasWs/gulp-file-includer#readme
- Issues: https://github.com/YodasWs/gulp-file-includer/issues
- npm.io page: https://npm.io/package/@yodasws/gulp-file-includer

## Dependencies (4)

- [through2](https://npm.io/package/through2.md) ~0.4.x
- [gulp-util](https://npm.io/package/gulp-util.md) ~2.2.x
- [event-stream](https://npm.io/package/event-stream.md) ~3.1.x
- [concat-stream](https://npm.io/package/concat-stream.md) ~1.4.x

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.1.1 (latest) — 2018-09-03
- 1.1.0 — 2018-09-03

## README

# gulp-file-includer

> A file include plugin for gulp 3

[npm-url]

## Installation

`yarn add --dev gulp-file-includer`

`npm install --save-dev gulp-file-includer`

## Usage

Add it to your `gulpfile.js`:

```javascript
var gulp = require('gulp')
var fileincluder = require('../index')

gulp.task('fileincluder', function() {
  gulp.src(['index.html'])
    .pipe(fileincluder())
    .pipe(gulp.dest('./result/'))
});

gulp.task('default', function() {
  gulp.run('fileincluder')
})
```

index.html
```html
<!DOCTYPE html>
<html>
  <body>
  @@include('./view.html')
  @@include('./var.html', {"name": "haoxin", "age": 12345})
  </body>
</html>
```

view.html
```html
<h1>view</h1>
```

var.html
```html
<label>@@name</label>
<label>@@age</label>
```

and the result is:
```html
<!DOCTYPE html>
<html>
  <body>
  <h1>view</h1>
  <label>haoxin</label>
<label>12345</label>
  </body>
</html>
```

## API

gulp-file-includer can be called with a config object with these attributes:
* **prefix** (defaults to '@@')
* **suffix** (defaults to '')
* **basePath** (defaults to '') If specified, the default root for the file path.

### License
MIT

[npm-url]: https://npmjs.org/package/@yodasws/gulp-file-includer

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