Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jameshemery/gulp-append-prepend
:heavy_plus_sign: Simple Gulp plugin to append/prepend.
https://github.com/jameshemery/gulp-append-prepend
gulp gulp-plugins plugin tool
Last synced: 4 months ago
JSON representation
:heavy_plus_sign: Simple Gulp plugin to append/prepend.
- Host: GitHub
- URL: https://github.com/jameshemery/gulp-append-prepend
- Owner: JamesHemery
- License: mit
- Created: 2016-07-10T23:30:55.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-06-01T21:12:23.000Z (over 2 years ago)
- Last Synced: 2024-04-23T17:34:08.047Z (10 months ago)
- Topics: gulp, gulp-plugins, plugin, tool
- Language: JavaScript
- Homepage:
- Size: 37.1 KB
- Stars: 15
- Watchers: 2
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# gulp-append-prepend
Simple Gulp plugin.
[![License:MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/JamesHemery/gulp-append-prepend/blob/master/LICENCE)
[![npm](https://img.shields.io/npm/v/gulp-append-prepend.svg)](https://www.npmjs.com/package/gulp-append-prepend)
[![Build](https://travis-ci.org/JamesHemery/gulp-append-prepend.svg)](https://travis-ci.org/JamesHemery/gulp-append-prepend)## Usage
First, install gulp-append-prepend as a development dependency:
```
npm install gulp-append-prepend --save-dev
```Then, add it to your gulpfile.js:
```javascript
const gap = require('gulp-append-prepend');gulp.task('myawesometask', function(){
gulp.src('index.html')
.pipe(gap.prependFile('header.html'))
.pipe(gap.prependText(''))
.pipe(gap.appendText(''))
.pipe(gap.appendFile('footer.html'))
.pipe(gulp.dest('www/'));
});
```This example works with html but you can use any type of file.
## Methods
- ``appendFile(filepath, separator)`` The filepath can be an array. The separator is optional by default is "\n".
- ``prependFile(filepath, separator)`` The filepath can be an array. The separator is optional by default is "\n".
- ``appendText(text, separator)`` The text can be an array. The separator is optional by default is "\n".
- ``prependText(text, separator)`` The text can be an array. The separator is optional by default is "\n".## Licence
This plugin is released under the [MIT licence](./LICENCE).## Disclaimer
Feel free to make changes in this README.