这个项目的峡谷位置是现在 木浆社区/木浆头。 。 。 .
纸浆头
使用更新的依赖关系伪造版本
原始重播时间 https://github.com/gulp-community/gulp-header 页面存档备份,存于互联网档案馆
这个版本用一个更简单的,仍然有效的替换来取代lodash模板. 所有测试仍然通过
ulp头是 古尔普 扩展以在管道中的文件中添加一个标题. Gulp 是一个流畅的构建系统 使用 节点.js。 。 。 .
安装
npm install --save-dev gulp-header
使用量
// assign the module to a local variable
var header = require('gulp-header');
// literal string
// NOTE: a line separator will not be added automatically
gulp.src('./foo/*.js')
.pipe(header('Hello'))
.pipe(gulp.dest('./dist/'))
// ejs style templating
gulp.src('./foo/*.js')
.pipe(header('Hello <%= name %>\n', { name : 'World'} ))
.pipe(gulp.dest('./dist/'))
// ES6-style template string
gulp.src('./foo/*.js')
.pipe(header('Hello ${name}\n', { name : 'World'} ))
.pipe(gulp.dest('./dist/'))
// using data from package.json
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/'))
// reading the header file from disk
var fs = require('fs');
gulp.src('./foo/*.js')
.pipe(header(fs.readFileSync('header.txt', 'utf8'), { pkg : pkg } ))
.pipe(gulp.dest('./dist/'))
// for use with coffee-script
return gulp.src([
'src/*.coffee',
])
.pipe(header(banner, { pkg : pkg } ))
.pipe(sourcemaps.init()) // init sourcemaps *after* header
.pipe(coffee({
bare: true
}))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist/js'))
问题和警报
我的手柄在推特上是 @ tracker1 (英语) - 如果有急事,我会收到推特通知.
API 密码
页眉( 文本, 数据)
文本
类型 : String
默认 : ''
模板文本.
数据
类型 : Object
默认 : {}
用于填充文本的数据对象 .
除了通过的数据, file 将会是 流对象 用于模板化文件 filename 将会是河道的相对位置.
注:使用 false 将禁用信头的模板处理