gulp-footer

Gulp extension to add footer to file(s) in the pipeline.

npm install gulp-footer
227 downloads in the last day
1 138 downloads in the last week
4 178 downloads in the last month

gulp-footer NPM version Build Status

Gulp extension to add a footer to file(s) in the pipeline

var footer = require('gulp-footer');

Usage

var footer = require('gulp-footer');

gulp.src('./foo/*.js')
  .pipe(footer('Hello'))
  .pipe(gulp.dest('./dist/')

gulp.src('./foo/*.js')
  .pipe(footer('Hello <%= name %>\n', { name : 'World'} ))
  .pipe(gulp.dest('./dist/')

gulp.src('./foo/*.js')
  .pipe(footer('Hello ${name}\n', { name : 'World'} ))
  .pipe(gulp.dest('./dist/')


//


var pkg = require('./package.json');
var banner = ['/**',
  ' * <%= pkg.name %> - <%= pkg.description %>',
  ' * @version v<%= pkg.version %>',
  ' * @link <%= pkg.homepage %>',
  ' * @license <%= pkg.license %>',
  ' */',
  ''].join('\n');

gulp.src('./foo/*.js')
  .pipe(footer(banner, { pkg : pkg } ))
  .pipe(gulp.dest('./dist/')

gulp.src('./foo/*.js')
  .pipe(footer.fromFile('banner.js', { pkg : pkg } ))
  .pipe(gulp.dest('./dist/')

API

text

Type: String
Default: ''

The template text.

data

Type: Object
Default: {}

The data object used to populate the text.

filePath

Type: String

The path of the template file.

data

Type: Object
Default: {}

The data object used to populate the text.

npm loves you