/conventional-changelog

Generate a changelog from git metadata

Primary LanguageJavaScript

NPM version Build Status Dependency Status Coverage Status

Generate a changelog from git metadata

Why

  • Used by AngularJS and related projects.
  • Everything internally or externally is Pluggable.
  • High performant. It doesn't spawn any extra child process to fetch data.
  • Fully configurable. There are several presets that you can use if you just want to use the same conventions. But it is also possible to configure if you want to go down to the nth degree.
  • Task runner integrations.
  • Actively maintained.

Install

$ npm install conventional-changelog

Adapted from code originally written by @vojtajina and @btford in grunt-conventional-changelog.

Note: As 0.1.x this module is rewritten and so the API is not backward compatible. If you are still using 0.0.x please checkout the README in your downloaded package or dig through the old tags.

Note: As the next release is still under development and we would like you to help test pre-release features, you can install by typing

$ npm install conventional-changelog@next

Synopsis of Conventions

Example output

Usage

var conventionalChangelog = require('conventional-changelog');

conventionalChangelog({
  preset: 'angular'
})
  .pipe(process.stdout);

API

conventionalChangelog([options, [context, [gitRawCommitsOpts, [parserOpts, [writerOpts]]]]])

Returns a readable stream.

options

preset

Type: string Possible values: 'angular', 'jquery', 'jshint'

A set of options of a popular project.

pkg

Type: string Default: 'package.json'

The location of your "package.json".

append

Type: boolean Default: false

Should the log be appended.

allBlocks

Type: boolean Default: false

Set to true if you want to generate all blocks of the log. false if you just want to generate the current one.

warn

Type: function Default: function() {}

A warn function. EG: grunt.verbose.writeln

transform

Type: object Default: through.obj()

A transform stream that applies after the parser and before the writer.

context

See the conventional-commits-writer docs.

gitRawCommitsOpts

See the git-raw-commits docs.

parserOpts

See the conventional-commits-parser docs.

writerOpts

See the conventional-commits-writer docs.

CLI

$ npm install -g conventional-changelog
$ conventional-changelog --help

  Generate a changelog from git metadata

  Usage
    conventional-changelog

  Example
    conventional-changelog -i CHANGELOG.md --overwrite

  Options
    -i, --infile              Read the CHANGELOG from this file.
    -o, --outfile             Write the CHANGELOG to this file. If unspecified, it prints to stdout
    -w, --overwrite           Overwrite the infile
    -p, --preset              Name of the preset you want to use
    -k, --pkg                 A filepath of where your package.json is located
    -a, --append              Should the generated block be appended
    -b, --all-blocks          Generate all blocks
    -v, --verbose             Verbose output
    -c, --context             A filepath of a javascript that is used to define template variables
    --git-raw-commits-opts    A filepath of a javascript that is used to define git-raw-commits options
    --parser-opts             A filepath of a javascript that is used to define conventional-commits-parser options
    --writer-opts             A filepath of a javascript that is used to define conventional-commits-writer options

Related

License

BSD