🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

gulp-append-prepend

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-append-prepend

A simple gulp plugin to append and prepend files.

1.0.2
Source
npm
Version published
Maintainers
1
Created
Source

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.prependFile('header.html'))
    .pipe(gap.prependText('<!-- HEADER -->'))
    .pipe(gap.appendText('<!-- FOOTER -->'))
    .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".
  • 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.

Keywords

gulpplugin

FAQs

Package last updated on 11 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts