New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

gulp-buildinfo-replace

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-buildinfo-replace

Inject version info into HTML (package.json, git commit, build info)

latest
Source
npmnpm
Version
1.0.6
Version published
Maintainers
1
Created
Source

gulp-buildinfo-replace

Inject version info into HTML (package.json, git commit, build info).

Build Status NPM version Dependency Status

Information

Packagegulp-buildinfo-replace
DescriptionInject build information into HTML (package.json, git commit, build info) as comments or meta tags.
Node Version>= 0.9
Gulp Version3.x

Usage

Install

$ npm install gulp-buildinfo-replace --save-dev

Example

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('./'));
});

Options

options.tag

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

options.indent

Number of spaces for indentation (for formatting).

Type: `Number`
Default: `4`

Example:

.pipe(buildInfoReplace({indent: 2}))

options.version

Places the package.json version.

Type: `Boolean`
Default: `true`

Example:

.pipe(buildInfoReplace({version: true}))

options.commit

Places the git commit.

Type: `Boolean`
Default: `false`

Example:

.pipe(buildInfoReplace({commit: true}))

options.branch

Places the git branch.

Type: `Boolean`
Default: `false`

Example:

.pipe(buildInfoReplace({branch: true}))

options.utcdate

Places the UTC formatted date.

Type: `Boolean`
Default: `false`

Example:

.pipe(buildInfoReplace({utcdate: true}))

options.buildms

Places the timestamp as milliseconds.

Type: `Boolean`
Default: `false`

Example:

.pipe(buildInfoReplace({buildms: true}))

options.meta

Places the build information as meta elements instead of comments.

Type: `Boolean`
Default: `false`

Example:

.pipe(buildInfoReplace({meta: true}))

options.gitdir

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'}))

options.unknownCommit

The string to use when the commit cannot be found.

Type: `String`
Default: `unknown`

Example:

.pipe(buildInfoReplace({unknownCommit: 'unknown_commit'}))

options.unknownBranch

The string to use when the branch cannot be found.

Type: `String`
Default: `unknown`

Example:

.pipe(buildInfoReplace({unknownBranch: 'unknown_branch'}))

LICENSE

MIT License

Keywords

gulp

FAQs

Package last updated on 24 May 2018

Did you know?

Socket

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.

Install

Related posts