gulp-header is a Gulp extension to add a header to file(s) in the pipeline. Gulp is a streaming build system utilizing node.js.
Install
npm install --save-dev gulp-header
Usage
// assign the module to a local variablevar header = ; // literal string// NOTE: a line separator will not be added automaticallygulp // ejs style templatinggulp // ES6-style template stringgulp // using data from package.jsonvar pkg = ;var banner = '/**' ' * <%= pkg.name %> - <%= pkg.description %>' ' * @version v<%= pkg.version %>' ' * @link <%= pkg.homepage %>' ' * @license <%= pkg.license %>' ' */' ''; gulp // reading the header file from diskvar fs = ;gulp // for use with coffee-scriptreturn gulp // init sourcemaps *after* header
Issues and Alerts
My handle on twitter is @tracker1 - If there is an urgent issue, I get twitter notifications sent to my phone.
API
header(text, data)
text
Type: String
Default: ''
The template text.
data
Type: Object
Default: {}
The data object used to populate the text.
In addition to the passed in data, file
will be the stream object for the file being templated against and filename
will be the path relative from the stream's basepath.
NOTE: using false
will disable template processing of the header