1 | # [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage Status][coveralls-image]][coveralls-url]
|
2 |
|
3 | > Generate a changelog from git metadata
|
4 |
|
5 | It's recommended to use high level [standard-version](https://github.com/conventional-changelog/standard-version).
|
6 | Alternatively, you are probably looking for the [cli](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-cli) module.
|
7 | Or use one of the plugins if you are already using the tool: [grunt](https://github.com/btford/grunt-conventional-changelog)/[gulp](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/gulp-conventional-changelog)/[atom](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-atom).
|
8 |
|
9 | ## Usage
|
10 |
|
11 | ```sh
|
12 | $ npm install --save conventional-changelog
|
13 | ```
|
14 |
|
15 | ```js
|
16 | var conventionalChangelog = require('conventional-changelog');
|
17 |
|
18 | conventionalChangelog({
|
19 | preset: 'angular'
|
20 | })
|
21 | .pipe(process.stdout); // or any writable stream
|
22 | ```
|
23 |
|
24 | Or if you want to use your own custom preset:
|
25 |
|
26 | ```js
|
27 | var conventionalChangelog = require('conventional-changelog');
|
28 |
|
29 | var config = require('@org/conventional-changelog-custom-preset');
|
30 | conventionalChangelog({config})
|
31 | .pipe(process.stdout); // or any writable stream
|
32 | ```
|
33 |
|
34 | ## API
|
35 |
|
36 | ### conventionalChangelog([options, [context, [gitRawCommitsOpts, [parserOpts, [writerOpts]]]]])
|
37 |
|
38 | Returns a readable stream.
|
39 |
|
40 | #### options
|
41 |
|
42 | See the [conventional-changelog-core](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-core) docs. The API is the same with the following changes or additions:
|
43 |
|
44 | ##### preset
|
45 |
|
46 | Type: `string` Possible values: `'angular', 'atom', 'codemirror', 'ember', 'eslint', 'express', 'jquery', 'jscs', 'jshint'`
|
47 |
|
48 | It's recommended to use a preset so you don't have to define everything yourself. Presets are names of built-in `config`.
|
49 |
|
50 | A scoped preset package such as `@scope/conventional-changelog-custom-preset` can be used by passing `@scope/custom-preset` to this option.
|
51 |
|
52 | **NOTE:** `options.config` will be overwritten by the values of preset. You should use either `preset` or `config`, but not both.
|
53 |
|
54 |
|
55 | ## [Notes for parent modules](https://github.com/conventional-changelog/conventional-changelog-core#notes-for-parent-modules)
|
56 |
|
57 |
|
58 | ## Related
|
59 |
|
60 | - [conventional-changelog-cli](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-cli) - cli of this module
|
61 | - [standard-changelog](https://github.com/conventional-changelog/standard-changelog) - Similar to this module but only with angular convention
|
62 | - [conventional-github-releaser](https://github.com/conventional-changelog/conventional-github-releaser) - Make a new GitHub release from git metadata
|
63 | - [conventional-recommended-bump](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-recommended-bump) - Get a recommended version bump based on conventional commits
|
64 | - [conventional-commits-detector](https://github.com/conventional-changelog/conventional-commits-detector) - Detect what commit message convention your repository is using
|
65 | - [commitizen](https://github.com/commitizen/cz-cli) - Simple commit conventions for internet citizens.
|
66 | - [angular-precommit](https://github.com/ajoslin/angular-precommit) - Pre commit with angular conventions
|
67 | - [commitlint](https://github.com/marionebl/commitlint) - Lint commit messages
|
68 |
|
69 | ## License
|
70 |
|
71 | MIT
|
72 |
|
73 | [npm-image]: https://badge.fury.io/js/conventional-changelog.svg
|
74 | [npm-url]: https://npmjs.org/package/conventional-changelog
|
75 | [travis-image]: https://travis-ci.org/conventional-changelog/conventional-changelog.svg?branch=master
|
76 | [travis-url]: https://travis-ci.org/conventional-changelog/conventional-changelog
|
77 | [daviddm-image]: https://david-dm.org/conventional-changelog/conventional-changelog.svg?theme=shields.io
|
78 | [daviddm-url]: https://david-dm.org/conventional-changelog/conventional-changelog
|
79 | [coveralls-image]: https://coveralls.io/repos/conventional-changelog/conventional-changelog/badge.svg
|
80 | [coveralls-url]: https://coveralls.io/r/conventional-changelog/conventional-changelog
|