Skip to content

Latest commit

 

History

History
73 lines (44 loc) · 3.33 KB

README.md

File metadata and controls

73 lines (44 loc) · 3.33 KB

NPM version Build Status Dependency Status Coverage Status

Generate a changelog from git metadata

You are probably looking for the cli module. Or use one of the plugins if you are already using the tool: grunt/gulp/atom.

Usage

$ npm install --save conventional-changelog
var conventionalChangelog = require('conventional-changelog');

conventionalChangelog({
  preset: 'angular'
})
  .pipe(process.stdout); // or any writable stream

API

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

Returns a readable stream.

options

See the conventional-changelog-core docs. The API is exactly the same with some additions:

preset

Type: string Possible values: 'angular', 'atom', 'codemirror', 'ember', 'eslint', 'express', 'jquery', 'jscs', 'jshint'

It's recommended to use a preset so you don't have to define everything yourself. The preset values can be overwritten. This value is case insensitive.

Notes for parent modules

This module has options append and releaseCount. However, it doesn't read your previous changelog. Reasons being:

  1. The old logs is just to be appended or prepended to the newly generated logs, which is a very simple thing that could be done in the parent module.
  2. We want it to be very flexible for the parent module. You could create a readable stream from the file or you could just read the file.
  3. We want the duty of this module to be very minimum.

So, when you build a parent module, you need to read the old logs and append or prepend to them based on options.append. However, if options.releaseCount is 0 you need to ignore any previous logs.

Related

License

MIT