Giter Site home page Giter Site logo

keep-a-changelog's Introduction

keep-a-changelog

Node package to parse and generate changelogs following the keepachangelog format.

Install

You can install it from the npm repository using npm/yarn:

npm install keep-a-changelog

Usage

const { parser } = require('keep-a-changelog');
const fs = require('fs');

//Parse a changelog file
const changelog = parser(fs.readFileSync('CHANGELOG.md', 'UTF-8'));

//Generate the new changelog string
console.log(changelog.toString());

Create a new changelog

const { Changelog, Release } = require('keep-a-changelog');

const changelog = new Changelog('My project')
    .addRelease(
        new Release('0.1.0', '2017-12-06')
            .added('New awesome feature')
            .added('New other awesome feature')
            .fixed('Bug #3')
            .removed('Drop support for X')
    )
    .addRelease(
        new Release('0.2.0', '2017-12-09')
            .security('Fixed security vulnerability')
            .deprecated('Feature X is deprecated')
    );

console.log(changelog.toString());

Cli

This library provides the changelog command to normalize the changelog format. It reads the CHANGELOG.md file and override it with the new format:

changelog

To use other file name:

changelog --file=History.md

To generate an empty new CHANGELOG.md file:

changelog --init

Available options:

Option Description
--file The markdown file of the changelog. The default value is CHANGELOG.md.
--url The base url used to build the diff urls of the different releases. It is taken from the existing diff urls in the markdown. If no urls are found, try to catch it using the url of the git remote repository.
--https Set to false to use http instead https in the url (--https=false).
--init Init a new empty changelog file.

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.