node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

topthat

topthat

A node binary that automatically updates all of the version strings in your bower/npm package. It will update your bower.json, package.json, and git tag the current version after committing those changes.

topthat assumes the current version of your app/library is in package.json.

Installation

Make sure you have Node installed, then run:

$ npm install -g topthat

Usage

You can use topthat right from the command line. Use in the same directory as your project to automatically update to the next minor version:

$ topthat
 
Updated to version 1.1.0 from 1.0.0!

To release a patch:

$ topthat patch
 
Updated to version 1.1.1 from 1.1.0!

You can perform a major version update too:

$ topthat major
 
Updated to version 2.0.0 from 1.1.1!

Finally, you can manually specify the new version:

$ topthat 2.1.2
 
Updated to version 2.1.2 from 2.0.0!

Banners

Add a JS comment banner (with project info, pulled from package.json) to any file using the --banner argument:

$ topthat --banner=dist/my-lib.js

Extra Files

By default, topthat attempts to bump the version in package.json and bower.json (if one exists). To bump the version in other JSON files, use the --files argument:

$ topthat --files=component.json

Development

Want to hack on topthat? Fork the repo on GitHub, then do a git clone of your fork. You'll want to run npm install from inside the folder you've checked out, then you just need to type npm link if you want to test the binary as a globally available command.

License

You can use this project freely under the Apache 2.0 license.

Copyright (c) 2014 by Matthew Riley MacPherson.