
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
gulp-buildinfo-replace
Advanced tools
Inject version info into HTML (package.json, git commit, build info)
Inject version info into HTML (package.json, git commit, build info).
| Package | gulp-buildinfo-replace |
| Description | Inject build information into HTML (package.json, git commit, build info) as comments or meta tags. |
| Node Version | >= 0.9 |
| Gulp Version | 3.x |
$ npm install gulp-buildinfo-replace --save-dev
var gulp = require('gulp');
var buildInfoReplace = require('gulp-buildinfo-replace');
// Basic usage:
gulp.task('buildInfo', function(){
gulp.src('./index.html')
.pipe(buildInfoReplace({meta: true})) // Elements will be meta tags, not comments
.pipe(gulp.dest('./'));
});
Set a specific tag to insert before it.
Type: `String`
Default: `head`
Example:
.pipe(buildInfoReplace({tag: 'head'})) // Puts the information into the 'head' DOM element
Number of spaces for indentation (for formatting).
Type: `Number`
Default: `4`
Example:
.pipe(buildInfoReplace({indent: 2}))
Places the package.json version.
Type: `Boolean`
Default: `true`
Example:
.pipe(buildInfoReplace({version: true}))
Places the git commit.
Type: `Boolean`
Default: `false`
Example:
.pipe(buildInfoReplace({commit: true}))
Places the git branch.
Type: `Boolean`
Default: `false`
Example:
.pipe(buildInfoReplace({branch: true}))
Places the UTC formatted date.
Type: `Boolean`
Default: `false`
Example:
.pipe(buildInfoReplace({utcdate: true}))
Places the timestamp as milliseconds.
Type: `Boolean`
Default: `false`
Example:
.pipe(buildInfoReplace({buildms: true}))
Places the build information as meta elements instead of comments.
Type: `Boolean`
Default: `false`
Example:
.pipe(buildInfoReplace({meta: true}))
Specifies the git directory to use. Useful if git modules are being used.
Type: `String`
Default: `process.cwd()`
Example:
.pipe(buildInfoReplace({gitdir: '../project-root/submodule'}))
The string to use when the commit cannot be found.
Type: `String`
Default: `unknown`
Example:
.pipe(buildInfoReplace({unknownCommit: 'unknown_commit'}))
The string to use when the branch cannot be found.
Type: `String`
Default: `unknown`
Example:
.pipe(buildInfoReplace({unknownBranch: 'unknown_branch'}))
FAQs
Inject version info into HTML (package.json, git commit, build info)
We found that gulp-buildinfo-replace 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.