gulp-append-prepend
Simple Gulp plugin for append or 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:
var gap = require('gulp-append-prepend');
gulp.task('myawesometask', function(){
gulp.src('index.html')
.pipe(gap.appendFile('header.html'))
.pipe(gap.appendText('<!-- HEADER -->'))
.pipe(gap.prependText('<!-- FOOTER -->'))
.pipe(gap.prependFile('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".prependText(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.
##Disclaimer
I am sorry for my poor English. Feel free to make changes in this README.