GithubHelp home page GithubHelp logo

conventional-changelog's Introduction

conventional-changelog

$ npm install conventional-changelog

Generate a changelog from git metadata, using these commit conventions.

View CONVENTIONS.md for a synposis of the conventions with commit examples.

Adapted from code originally written by @vojtajina, from grunt-conventional-changelog.

Example output

Recommended usage: use in your workflow with https://github.com/btford/grunt-conventional-changelog.

Documentation

Simple usage:

require('changelog')({
  repository: 'https://github.com/joyent/node',
  version: require('./package.json').version
}, function(err, log) {
  console.log('Here is your changelog!', log);
});

changelog(options, callback)

By default, calls the callback with a string containing a changelog from the previous tag to HEAD, using pkg.version, prepended to existing CHANGELOG.md (if it exists).

callback is the second parameter, and takes two parameters: (err, log). log is a string containing the newly generated changelog, and err is either an error or null.

options is the first parameter, an object. The following fields are available:

  • version {string} - The version to be written to the changelog. For example, {version: require('./package.json').version}

  • subtitle {string} - A string to display after the version title in the changelog. For example, it will show '## 1.0.0 "Super Version"' if codename '"Super Version"' is given. By default, it's blank.

  • repository {string} - If this is provided, allows issues and commit hashes to be linked to the actual commit. Usually used with github repositories. For example, {repository: 'http://github.com/joyent/node'}

  • commitLink {function(commitHash)} - If repository is provided, this function will be used to link to commits. By default, returns a github commit link based on options.repository: opts.repository + '/commit/' + hash

  • issueLink {function(issueId)} - If repository is provided, this function will be used to link to issues. By default, returns a github issue link based on options.repository: opts.repository + '/issues/' + id

  • from {string} - Which commit the changelog should start at. By default, uses previous tag, or if no previous tag the first commit.

  • to {string} - Which commit the changelog should end at. By default, uses HEAD.

  • file {string} - Which file to read the current changelog from and prepend the new changelog's contents to. By default, uses 'CHANGELOG.md'.

  • log {function()} - What logging function to use. For example, {log: grunt.log.ok}. By default, uses console.log.

  • warn {function()} - What warn function to use. For example, {warn: grunt.log.writeln}. By default, uses console.warn.

License

BSD

conventional-changelog's People

Contributors

ajoslin avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.