Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
gulp-header-comment
Advanced tools
gulp-header-comment is a Gulp extension to add comments to file(s) in the pipeline.
npm install --save-dev gulp-header-comment
const headerComment = require('gulp-header-comment');
gulp.src('**/*.js')
.pipe(headerComment('License MIT'))
.pipe(gulp.dest('./dist/'))
The generated comment will use:
/**
and ends with */
).<!--
and ends with -->
).appcache
and hidden files (i.e starts with #
).See https://github.com/3rd-Eden/commenting, as this package is used to generate comments according to file extensions.
Header strings can use lodash
, moment
and data from package.json
:
const headerComment = require('gulp-header-comment');
gulp.src('**/*.js')
.pipe(headerComment(`
License: <%= pkg.license %>
Generated on <%= moment().format('YYYY') %>
Author: <%= _.capitalize(pkg.author) %>
`))
.pipe(gulp.dest('./dist/'))
You can also point to a file on disk:
const headerComment = require('gulp-header-comment');
gulp.src('**/*.js')
.pipe(headerComment({
file: path.join(__dirname, 'header.txt'),
encoding: 'utf-8', // Default is UTF-8
}))
.pipe(gulp.dest('./dist/'))
See here.
MIT License (MIT)
If you find a bug or think about enhancement, feel free to contribute and submit an issue or a pull request.
0.10.0 (2021-11-15)
FAQs
Gulp plugin to add header comments to files
The npm package gulp-header-comment receives a total of 857 weekly downloads. As such, gulp-header-comment popularity was classified as not popular.
We found that gulp-header-comment demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.