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

@tomerfi/version-bumper

v4.0.3

Published

A Node.js executable package determining semantic version bumps based on the conventional commits spec.

Downloads

36

Readme

Version Bumperdocker-version-badge npm-version-badge

A Node.js executable package determining semantic version bumps based on the conventional commits spec.

See also version-bumper-action GitHub action.

# old v2 run command
docker run --rm -v $PWD:/usr/share/repo tomerfi/version-bumper:latest --repopath /path/to/git --bumpoverride major
# new v3 run command
docker run --rm -v $PWD:/repo tomerfi/version-bumper:latest --repo /path/to/git --bump major

Usage

The version-bumper tool is executed using npx or consumed as a standard package. We also push a container image encapsulating the executable package to docker hub.

Automatic Bumps

The following examples assume:

  • The current working directory is a git repository.
  • The latest semver tag is 2.1.4.
  • Commit messages are based on the conventional commits spec.
$ npx @tomerfi/version-bumper@latest

$ docker run --rm -v $PWD:/repo tomerfi/version-bumper:latest
$ podman run --privileged --rm -v $PWD:/repo:ro docker.io/tomerfi/version-bumper:latest

For commits with a fix type, the output of the above commands will be:

{"current":"2.1.4","bump":"patch","next":"2.1.5","dev":"2.1.6-dev"}

For commits with a feat type, the output of the above commands will be:

{"current":"2.1.4","bump":"minor","next":"2.2.0","dev":"2.2.1-dev"}

For commits containing the text BREAKING CHANGE in their body, the output of the above commands will be:

{"current":"2.1.4","bump":"major","next":"3.0.0","dev":"3.0.1-dev"}

Manual Bumps

Occasionally, we may want to use this only for bumps; no git repository is required.

$ npx @tomerfi/version-bumper@latest -s 2.1.4 -b patch

$ docker run --rm tomerfi/version-bumper:latest -s 2.1.4 -b patch

{"current":"2.1.4","bump":"patch","next":"2.1.5","dev":"2.1.6-dev"}
$ npx @tomerfi/version-bumper@latest -s 2.1.4 -b minor

$ docker run --rm tomerfi/version-bumper:latest -s 2.1.4 -b minor

{"current":"2.1.4","bump":"minor","next":"2.2.0","dev":"2.2.1-dev"}
$ npx @tomerfi/version-bumper@latest -s 2.1.4 -b major

$ docker run --rm tomerfi/version-bumper:latest -s 2.1.4 -b major

{"current":"2.1.4","bump":"major","next":"3.0.0","dev":"3.0.1-dev"}

ES Module

import { bumper } from '@tomerfi/version-bumper'

// prints { current: '2.1.4', bump: 'patch', next: '2.1.5', dev: '2.1.5-dev' }
bumper({source: "2.1.4", bump: 'patch'}).then(bump => console.log(bump))

// prints { current: '2.1.4', bump: 'minor', next: '2.2.0', dev: '2.2.1-dev' }
bumper({source: "2.1.4", bump: 'minor'}).then(bump => console.log(bump))

// prints { current: '2.1.4', bump: 'major', next: '3.0.0', dev: '3.0.1-alpha1' }
bumper({source: "2.1.4", bump: 'minor', label: '-alpha1'}).then(bump => console.log(bump))

Contributors all-contributors-badge

Contributing guidelines are here.