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 🙏

© 2024 – Pkg Stats / Ryan Hefner

tagver

v1.1.1

Published

semver tagging control for git

Downloads

10

Readme

tagver

Package Quality Dependencies

semver tagging control for git

tagver gets/sets git version tags, using semantic versioning (semver).

By default, tagver will bump, tag and push updated version tags to the git repository.

Node API

tagver([options])

Gets the current highest semver version tag from git

returns: Promise

tagver().then(version => console.log(version));

options

{
  cwd: './',  // Directory which tagver should use for git commands
  filter: '*', // Semver filter to use. This will return the highest version based on the filter.
  includePrerelease: false // Include prerelease versions, when getting tags. This automatically gets set to true when bumping pre versions.
}

tagver(version[, options])

Bumps the version based on the input.

Version can be a valid semver version number, or, release type.

returns: Promise

tagver('1.2.3').then(version => console.log(version));
tagver('major').then(version => console.log(version));
tagver('minor').then(version => console.log(version));
tagver('patch').then(version => console.log(version));
tagver('prerelease', { preid: 'beta' }).then(version => console.log(version));

options

{
  cwd: './',              // Directory which tagver should use for git commands
  tag: true,              // Should tagver store a git tag?
  publish: true,          // Should tagver publish new tags to the remote?
  message: 'Release v%s', // Custom tag message. %s will be replaced with the version number
  base: '0.0.0',          // Initial version to increment when no version is found
  filter: '*',            // Semver filter to use. This will return the highest version based on the filter.
  preid: undefined,       // Preid to use when prerelease versions
  branch: undefined,       // Remote branch used to compare local changes against
  includePrerelease: false // Include prerelease versions, when getting tags. This automatically gets set to true when bumping pre versions.
}

Cli Usage

$ npm i -g tagver

tagver

Returns the current highest semver version tag from git

$ git tag
test-tag
v0.1.0
v0.1.1
v0.1.10
v0.1.11

$ tagver
0.1.11

tagver x.x.x

Bumps the version to the one specified

$ tagver 1.2.3
1.2.3

tagver major

Bumps the major version

$ tagver
1.2.3

$ tagver major
2.0.0

tagver minor

Bumps the minor version

$ tagver
1.2.3

$ tagver minor
1.3.0

tagver patch

Bumps the patch version

$ tagver
1.2.3

$ tagver patch
1.2.4

tagver premajor

Bumps the pre-release major version

$ tagver
1.2.3

$ tagver premajor
2.0.0-0

tagver preminor

Bumps the pre-release minor version

$ tagver
1.2.3

$ tagver preminor
1.3.0-0

tagver prepatch

Bumps the pre-release patch version

$ tagver
1.2.3

$ tagver prepatch
1.2.4-0

tagver prerelease

Bumps the pre-release version

$ tagver
1.2.3-0

$ tagver prerelease
1.2.3-1

--message, -m option

Optional message to use for git tags.

%s will be replaced with the version number.

default: Release v%s

$ tagver patch -m "Auto release package [v%s]"

--base, -b option

Optional version to increment when no version is found.

default: 0.0.0

$ tagver patch -b "1.0.0"

--preid option

Optional identifier to be used to prefix premajor, preminor, prepatch or prerelease version increments.

$ tagver
1.2.3

$ tagver prepatch --preid next
1.2.4-next.0

--filter, -f option

Optional semver filter to use. This will return the highest version based on the filter.

default: *

$ tagver
1.2.3
$ tagver -f "<1.2.x"
1.1.18

--branch option

Remote branch used to compare local changes against. Cannot tag unless remote and local repositories are in sync. Defaults to the default remote branch, usually master.

--include-prerelease option

Include prerelease versions, when getting tags. This automatically gets set to true when bumping pre versions.

--no-git-tag option

Prevents tagver from creating a git tag. This will also prevent any publishing of tags.

$ git tag
v1.2.0
v1.2.1
v1.2.2
v1.2.3

$ tagver
1.2.3

$ tagver minor --no-git-tag
1.2.4

$ git tag
v1.2.0
v1.2.1
v1.2.2
v1.2.3

--no-git-publish option

Prevents tagver from publishing created tags.