Changelog is a command line utility (and module) that generates a changelog in markdown, json, or color output for Node modules in npm and any public github.com repo.
Modules do not need to be installed locally to get a changelog but they must define their repository url in their package.json.
$ changelog {npm module name} [release] [options]
npm module
: The module name, such as express
.
Changelog also works on any public Github repo.
$ changelog {Github.com repo url} [options]
Github.com repo url
: Urls can be any format, such as https://github.com/dylang/changelog
or git@github.com:dylang/changelog.git
or even just github.com/dylang/changelog
.
Usage:
changelog <npm module name> [release] [options]
changelog <github repo url> [release] [options]
Release:
latest Show only the latest release. ie: changelog express latest
number Show that many recent releases. ie: changelog express 3
n.n.n Show changes for a specific release. ie: changelog express 2.4.4
Options:
-c, --color Output as Color (terminal default)
-m, --markdown Output as Github-flavored Markdown (file default)
-j, --json Output as JSON
-d, --debug Enable debugging
-h, --help Display help and usage details
Using npm just do:
$ npm-g install changelog
Using npm-g
installs changelog globally so you can use changelog
anywhere. You can also just use npm install changelog
if you are using it as a module for another project.
To make sure you have the latest version:
$ npm-g update
This will update all of your global modules.
Changelog can be easily integrated into other tools.
var Changelog = require('changelog');
Changelog.npm('express', callback);
Changelog.github('joyent/node', callback);
function callback(err, data) {
//Check err for errors or just throw
if (err) throw err;
//With npm each "version" corresponds to all changes for that build pushed on npm
//With github each "version" is one GMT day of changes
data.versions.forEach(function(version) {
console.log(version.version); //currently npm projects only
console.log(version.date); //JS Date
//version.changes is an array of commit messages for that version
version.changes.forEach(function(change) {
console.log(' * ' + change);
});
});
//Information about the project
console.log(data.project);
}
- Changelog uses the Github V3 API and npmjs.org API.
- Add header and/or footer to the output with module name, contributors, etc.
- Support private Github repos and Github Fi.
- Better color choices for those with default terminal colors.
- Support versions/releases for Github repositories (waiting for Github to address Github API Issue #17).
- Support paging Github's API to aquire more than 100 commit messages.
Here are some ideas I have no idea how to do.
- Support for
brew
andgem
? - Integrate into
npm update
? - Create a
git pull
shortcut?
Dylan Greene built this because he was always curious what was changed when doing npm update
.
This module's name is inspired by listening to TheChangelog Podcast on the way to work.