在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):douglasduteil/gulp-header开源软件地址(OpenSource Url):https://github.com/douglasduteil/gulp-header开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):gulp-headerGulp extension to add a header to file(s) in the pipeline var header = require('gulp-header'); Usagevar header = require('gulp-header');
gulp.src('./foo/*.js')
.pipe(header('Hello'))
.pipe(gulp.dest('./dist/')
gulp.src('./foo/*.js')
.pipe(header('Hello <%= name %>\n', { name : 'World'} ))
.pipe(gulp.dest('./dist/')
gulp.src('./foo/*.js')
.pipe(header('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(header(banner, { pkg : pkg } ))
.pipe(gulp.dest('./dist/')
gulp.src('./foo/*.js')
.pipe(header.fromFile('banner.js', { pkg : pkg } ))
.pipe(gulp.dest('./dist/') APIheader(text, data)textType: The template text. dataType: The data object used to populate the text. header.fromFile(filePath, data)filePathType: The path of the template file. dataType: The data object used to populate the text. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论