1.0.12 • Published 5 years ago

gulp-header-license v1.0.12

Weekly downloads
547
License
Apache License
Repository
github
Last release
5 years ago

gulp-header-license NPM version

License plugin for Gulp. gulp-header-license is a Gulp extension to add a header license to file(s) in the pipeline.

Install

npm install gulp-header-license --save-dev

Basic Usage

Something like this will add license to your file(s):

var gulp = require("gulp");
var license = require('gulp-header-license');

gulp.task('license', function () {
    var year = (new Date()).getFullYear();
    gulp.src('./assets/**/*.js')
            .pipe(license('Copyright (c) ${year}, B3log.org', {year: year}))
            .pipe(gulp.dest('./public/'));
});

You can also use header.txt, doing something like this:

'use strict';

var gulp = require("gulp");
var license = require('gulp-header-license');
var fs = require('fs');

gulp.task('license', function () {
    var year = (new Date()).getFullYear();
    gulp.src('./assets/**/*.js')
            .pipe(license(fs.readFileSync('header.txt', 'utf8'), {year: year}, 0.9))
            .pipe(gulp.dest('./public/'));
});

Options

license:String

The license template string.

config:JSON

The JSON object used to populate the license template.

rate:Float, default value is 0.8.

Less then this rate, add license, otherwise update license.

1.0.11

5 years ago

1.0.12

5 years ago

1.0.10

6 years ago

1.0.9

9 years ago

1.0.8

9 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

11 years ago

1.0.0

11 years ago