{"id":27938810,"url":"https://github.com/osdio/gulp-version-tag","last_synced_at":"2025-05-07T08:57:55.495Z","repository":{"id":26370256,"uuid":"29819488","full_name":"osdio/gulp-version-tag","owner":"osdio","description":"A gulp plugin for add version num to file name and auto gain version num in package.json.","archived":false,"fork":false,"pushed_at":"2015-04-23T08:43:42.000Z","size":340,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-07T08:57:51.095Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://soliury.github.io/gulp-version-tag","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/osdio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-25T15:52:13.000Z","updated_at":"2016-12-22T20:06:11.000Z","dependencies_parsed_at":"2022-08-28T21:41:52.971Z","dependency_job_id":null,"html_url":"https://github.com/osdio/gulp-version-tag","commit_stats":null,"previous_names":["soliury/gulp-version-tag"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osdio%2Fgulp-version-tag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osdio%2Fgulp-version-tag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osdio%2Fgulp-version-tag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osdio%2Fgulp-version-tag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osdio","download_url":"https://codeload.github.com/osdio/gulp-version-tag/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252847507,"owners_count":21813450,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-07T08:57:54.708Z","updated_at":"2025-05-07T08:57:55.485Z","avatar_url":"https://github.com/osdio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# gulp-version-tag\n[![NPM version][npm-image]][npm-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependency Status][depstat-image]][depstat-url]\n\n\u003e gulp-version-tag plugin for [gulp](https://github.com/wearefractal/gulp).\n\u003e \n\u003e Just for attach versionTag to your file. And it can auto gain the version number.\n\n## Usage\n\nFirst, install `gulp-version-tag` as a development dependency:\n\n```\nnpm install --save-dev gulp-version-tag\n```\n\nThen, add it to your `gulpfile.js`:\n\n```\nvar gulp-version-tag = require(\"gulp-version-tag\");\n\ngulp.src(\"./src/*.js\")\n\t.pipe(gulp-version-tag(__dirname,'./package.json'))\n\t.pipe(gulp.dest(\"./dist\"));\n```\n\n## API\n\n### gulp-version-tag(__dirname, packagejsonPath, [options])\n\n#### __dirname\nType: `String` \n\nRequired: `true`\n\nWhen using, just set the this param to `__dirname`.\n\nExample:\n\n```\ngulp.task 'default', -\u003e\n\tgulp.src '../test/**/**.txt'\n\t.pipe versionTag __dirname, '../test/package.json'\n\t.pipe gulp.dest './dest'\n```\n\n#### packagejsonPath\nType: `String`  \n\nRequired: `true`\n\nThis is the relative path from where you use gulp-version-tag to the `package.json`.\n\nExample:\n\nJust see above example. And the file structrue for the example is :\n\n```\nexample\n    gulpfile.coffee\ntest\n    package.json\n```\n\nAnd the `gulp file.coffee` is the example file.\n\n#### options\n\nType: `Object`\n\nRequired: `false`\n\n##### options.reuse\n\nType: `Bool`\n\nRequired: `false`\n\nDefault: `true`\n\nIf 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`.\n\nIf you set this value to `false`, it won't check the value of `global.versionTag` every time you run a gulp task.\n\nFor example:\n\n```\ngulp.task 'task1', -\u003e\n\tgulp.src '../test/expected/**.txt'\n\t.pipe versionTag __dirname, '../test/package.json',\n#\t\treuse: false\n\t\tprefix: '-v'\n\t\tsuffix: ''\n#\t\tautoSave:false\n#\t\tautoTagVersion: false\n\t.pipe gulp.dest './dest'\n\ngulp.task 'task2', -\u003e\n\tgulp.src '../test/fixtures/**.txt'\n\t.pipe versionTag __dirname, '../test/package.json',\n#\t\treuse: false\n\t\tprefix: '-v'\n\t\tsuffix: ''\n#\t\tautoSave:false\n#\t\tautoTagVersion: false\n\t.pipe gulp.dest './dest'\n\n\ngulp.task 'default', ['task1', 'task2']\n\n```\n\nWhen 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. \n\nFor more example, just see my another project: [ngFast](https://github.com/soliury/ngFast).\n\n#### options.prefix\n\nType: `String`\n\nDefault: `'-v'`\n\nThe text to add before version num.\n\n#### options.suffix\n\nType: `String`\n\nDefault: `''`\n\nThe text to add after version num.\n\nExample:\n\n```\ngulp.task 'default', -\u003e\n\tgulp.src '../test/**/**.txt'\n\t.pipe versionTag __dirname, '../test/package.json',\n\t\tglobal: true\n\t\tprefix: '---v'\n\t\tsuffix: '---'\n\t.pipe gulp.dest './dest'\n```\n\n#### options.autoSave\n\nType: `Bool`\n\nDefault: `true`\n\nIf the value is `true`, When running `gulp-version-tag`, it will auto save the version change to `package.json`.\n\n#### options.autoTagVersion\n\nType: `Bool`\n\nDefault: `true`\n\nIf 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.\n\nFor more example, just [see](https://github.com/soliury/gulp-version-tag/blob/master/example/gulpfile.coffee).\n\n#### options.type\n\nType: `String`\n\nDefault: `patch`\n\n**patch**: v0.0.1    --\u003e    v0.0.2\n\n**feature**: v0.0.1    --\u003e    v0.1.1\n\n**release**: v0.0.1    --\u003e    v1.0.1\n\n### Another use\n\n```\ngulp = require 'gulp'\nversionTag = require '../index'\nVersion = require '../util'\n\n\nversion = new Version __dirname, '../test/package.json',\n\tautoSave: true\n\n\ngulp.task 'patch', -\u003e\n\tversion.patch()\n\tconsole.log \"version changed to #{version.version}\"\n\ngulp.task 'feature', -\u003e\n\tversion.feature()\n\tconsole.log \"version changed to #{version.version}\"\n\ngulp.task 'release', -\u003e\n\tversion.release()\n\tconsole.log \"version changed to #{version.version}\"\n\n```\n\nThis can ease to update the package version. More details focus on [gulpfile](https://github.com/soliury/gulp-version-tag/blob/master/gulpfile.coffee)\n\n\n\n\n## License\n\n[MIT License](http://en.wikipedia.org/wiki/MIT_License)\n\n[npm-url]: https://npmjs.org/package/gulp-version-tag\n[npm-image]: https://badge.fury.io/js/gulp-version-tag.png\n\n[travis-url]: http://travis-ci.org/soliury/gulp-version-tag\n[travis-image]: https://secure.travis-ci.org/soliury/gulp-version-tag.png?branch=master\n\n[coveralls-url]: https://coveralls.io/r/soliury/gulp-version-tag\n[coveralls-image]: https://coveralls.io/repos/soliury/gulp-version-tag/badge.png\n\n[depstat-url]: https://david-dm.org/soliury/gulp-version-tag\n[depstat-image]: https://david-dm.org/soliury/gulp-version-tag.png\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosdio%2Fgulp-version-tag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosdio%2Fgulp-version-tag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosdio%2Fgulp-version-tag/lists"}