Security News
UK Officials Consider Banning Ransomware Payments from Public Entities
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
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 human-readable timestamp will be appended as well, e.g. 1.0.0-SNAPSHOT.20170920104533123
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.20170920104533123"
git tag -a v0.1.1 -m "v0.1.1"
console.log(gitVersion()); // will print "0.1.1"
An npm cli task is also available; it's options are exactly the same as JS version.
git-tag-version [--uniqueSnapshot | --unique-snapshot]
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.
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
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.