Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
git-tag-version
Advanced tools
Calculate project version from git tags.
This module provides a function that calculates and returns project's current version based on git tags. It is very useful when you need to calculate your project version in CI or deployment plans.
This moudle has been based on and is a more generalised (framework-agnostic) version of grunt-release-plugin by Jerzy Jelinek.
npm install git-tag-version --save-dev
Once the module has been installed, just load it in your node project:
var gitVersion = require('git-tag-version');
gitVersion(options);
Parameter options
is optional. It may contain these options:
uniqueSnapshot
(default = false
)-SNAPSHOT
, e.g. 1.0.0-SNAPSHOT
;
otherwise, current abbreviated git commit's hash will be appended as well, e.g. 1.0.0-SNAPSHOT.c1b653ff
git init
touch file.js
git add file.js
git commit -m "add file.js"
git tag -a v0.1.0 -m "v0.1.0"
console.log(gitVersion()); // will print "0.1.0"
touch file2.js
git add file2.js
git commit -m "add file2.js"
console.log(gitVersion()); // will print "0.1.1-SNAPSHOT"
console.log(gitVersion({uniqueSnapshot: true})); // will print something like "0.1.1-SNAPSHOT.c1b653ff"
git tag -a v0.1.1 -m "v0.1.1"
console.log(gitVersion()); // will print "0.1.1"
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
FAQs
Calculate project version from git tags.
The npm package git-tag-version receives a total of 835 weekly downloads. As such, git-tag-version popularity was classified as not popular.
We found that git-tag-version demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.