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

bumpversion

v0.1.3

Published

A version bumping tool based on node.js

Downloads

4

Readme

bumpversion

Bump the version to a json file (VERSION.json)

Getting Started

Install the module with: npm install bumpversion

After the installation, you can run

$ bumpversion -m v0.1.1 -c 1

And it would return would something like

version bumped to:
 {
    "cache": 1,
    "timestamp": "2013-06-03T03:57:17.273Z",
    "main": "v0.1.1"
}

Meanwhile, a file named VERSION.json would be created with same content.

VERSION.json

  • main A string field, indicating the main version. Could be something like "release/v1.2.3"
  • cache A integer field indicating the cache version. A good usercase of this field is CDN versioning. If you do not specify "-c", this field would be self increment.
  • timestamp A GMT timestamp indicating when the file being generated.
  • last_commits If you are using git, you can call bumpversion -lc 3, it would include last three commits version hash and log message into last_commits.

Examples

If you execute "bumpversion" inside a git repository without specifying "-m", it will automatically take the branch name as main version.

Take git branch as main version.

Now I am inside a git repository:

$ git branch
  develop
  master
* release/0.1.1

Now execute "bumpversion"

$ bumpversion
version bumped to:
 {
    "cache": 5,
    "timestamp": "2013-06-03T03:53:55.972Z",
    "main": "release/0.1.1"
}

Include the last N GIT commit hash / log into VERSION.json

Including last 2 commits

bumpversion -lc 2
version bumped to:
 {
    "cache": 2,
    "timestamp": "2013-06-03T04:16:18.487Z",
    "main": "release/0.1.1",
    "last_commits": [
        "0f0ef3da436f5f5f71dcbf78ce720bcd2ff47e7e version bumped",
        "a9b14b2ee13a532534d8e75e0e83192534cbd8cc Merge branch 'release/0.1' into develop"
    ]
}

Including last 5 commits

bumpversion -lc 5
version bumped to:
 {
    "cache": 3,
    "timestamp": "2013-06-03T04:19:07.317Z",
    "main": "release/0.1.1",
    "last_commits": [
        "0f0ef3da436f5f5f71dcbf78ce720bcd2ff47e7e version bumped",
        "a9b14b2ee13a532534d8e75e0e83192534cbd8cc Merge branch 'release/0.1' into develop",
        "82f901f53fe61fc469c869a5da009aaec26d4b06 include the test",
        "73a5c11f9675f67556ad691f023255761568bf97 misc changes",
        "83c4c440ac4b47fc0d6fbb5f5b84339889e0e075 add package.json"
    ]
}

Usage

Displaying the help

$> bumpversion -h
usage: bumpversion [-h] [-v] [-m M] [-c C] [-q] [-lc LC]

A tool to generate / bump the version to a JSON file.

Optional arguments:
  -h, --help     Show this help message and exit.
  -v, --version  Show program's version number and exit.
  -m M           Update the main version. If you do not specify version
                 number, Main version will be take it as git branch by
                 default.
  -c C           Update the cache version. If you not specify version number,
                 it would be a self increment number
  -q             quiet mode.
  -lc LC         Update the last default commit

Best Practice

bumpversion is particular useful when you use it with git flow / hubflow. You can call bumpversion -lc 2 every time you are about to close your release or hotfix branch, namely (git flow release finish / git flow hotfix finish). It would automatically record take the branch name as main version and include the last commits log into VERSION.json.

Release History

(Nothing yet)

License

Copyright (c) 2012 Tom Tang
Licensed under the BSD license.