npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gulp-version-tag

v0.0.10

Published

A plugin for Gulp

Readme

gulp-version-tag

NPM version Coverage Status Dependency Status

gulp-version-tag plugin for gulp.

Just for attach versionTag to your file. And it can auto gain the version number.

Usage

First, install gulp-version-tag as a development dependency:

npm install --save-dev gulp-version-tag

Then, add it to your gulpfile.js:

var gulp-version-tag = require("gulp-version-tag");

gulp.src("./src/*.js")
	.pipe(gulp-version-tag(__dirname,'./package.json'))
	.pipe(gulp.dest("./dist"));

API

gulp-version-tag(__dirname, packagejsonPath, [options])

__dirname

Type: String

Required: true

When using, just set the this param to __dirname.

Example:

gulp.task 'default', ->
	gulp.src '../test/**/**.txt'
	.pipe versionTag __dirname, '../test/package.json'
	.pipe gulp.dest './dest'

packagejsonPath

Type: String

Required: true

This is the relative path from where you use gulp-version-tag to the package.json.

Example:

Just see above example. And the file structrue for the example is :

example
    gulpfile.coffee
test
    package.json

And the gulp file.coffee is the example file.

options

Type: Object

Required: false

options.reuse

Type: Bool

Required: false

Default: true

If you set this value to true, when run gulp-version-tag, if global.versionTag have value, it will use the value of it as version. And once you run a task, it will set global.versionTag to the version read from package.json.

If you set this value to false, it won't check the value of global.versionTag every time you run a gulp task.

For example:

gulp.task 'task1', ->
	gulp.src '../test/expected/**.txt'
	.pipe versionTag __dirname, '../test/package.json',
#		reuse: false
		prefix: '-v'
		suffix: ''
#		autoSave:false
#		autoTagVersion: false
	.pipe gulp.dest './dest'

gulp.task 'task2', ->
	gulp.src '../test/fixtures/**.txt'
	.pipe versionTag __dirname, '../test/package.json',
#		reuse: false
		prefix: '-v'
		suffix: ''
#		autoSave:false
#		autoTagVersion: false
	.pipe gulp.dest './dest'


gulp.task 'default', ['task1', 'task2']

When you running many tasks, and you want to use the same version, you should not set reuse to false.Just like the example above, task1 and task2 can use the same version, it only auto gain version once, and save once.

For more example, just see my another project: ngFast.

options.prefix

Type: String

Default: '-v'

The text to add before version num.

options.suffix

Type: String

Default: ''

The text to add after version num.

Example:

gulp.task 'default', ->
	gulp.src '../test/**/**.txt'
	.pipe versionTag __dirname, '../test/package.json',
		global: true
		prefix: '---v'
		suffix: '---'
	.pipe gulp.dest './dest'

options.autoSave

Type: Bool

Default: true

If the value is true, When running gulp-version-tag, it will auto save the version change to package.json.

options.autoTagVersion

Type: Bool

Default: true

If the value is true, it will auto change the version number, if the version in your package.json is 0.0.1, a file file01 will be changed to file01-v0.0.02 after running.

For more example, just see.

options.type

Type: String

Default: patch

patch: v0.0.1 --> v0.0.2

feature: v0.0.1 --> v0.1.1

release: v0.0.1 --> v1.0.1

Another use

gulp = require 'gulp'
versionTag = require '../index'
Version = require '../util'


version = new Version __dirname, '../test/package.json',
	autoSave: true


gulp.task 'patch', ->
	version.patch()
	console.log "version changed to #{version.version}"

gulp.task 'feature', ->
	version.feature()
	console.log "version changed to #{version.version}"

gulp.task 'release', ->
	version.release()
	console.log "version changed to #{version.version}"

This can ease to update the package version.

License

MIT License