ksm2 / protokollant-ts

TypeScript library and CLI to manage CHANGELOG.md files

Home Page:https://www.npmjs.com/package/protokollant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Protokollant

Node.js CI

The Protokollant keeps your changelog easily maintained.

Library

You can use Protokollant as a library with native TypeScript support.

Install via Yarn:

yarn add protokollant

Usage:

import fs from 'fs'
import { parseChangelog, printChangelog } from 'protokollant'

// Parse a CHANGELOG.md
const oldVersion = fs.readFileSync('CHANGELOG.md', 'utf8')
const changelog = parseChangelog(oldVersion)

// Do some changes ...
changelog.getUnreleased().added('Unicorn farm auto-pet machine')
// Or as a shortcut:
changelog.added('Unicorn farm auto-pet machine')

// Create a new release "14.0.5" from "unreleased" changes
changelog.release('14.0.5')

// Print the new changelog
const newVersion = printChangelog(changelog)

CLI

You can also use Protokollant as a CLI tool.

To achieve the same as the code above:

protokollant added Unicorn farm auto-pet machine

Quotes are optional, but if you use special chars, you should add them.

You specify the CHANGELOG.md file as follows (default is looking for CHANGELOG.md in the current directory):

protokollant --changelog MY_CHANGED_FILES.md added ...

The following commands create new entries:

  • protokollant changed ... adds a new unreleased change.
  • protokollant added ... adds a new unreleased addition.
  • protokollant fixed ... adds a new unreleased fix.
  • protokollant removed ... adds a new unreleased removal.

You can also release using the release command:

protokollant release 14.0.5

Use the extract command to export a specific release to stdout. You can pipe it to a new file like this:

protokollant extract 14.0.5 > release-14.0.5.md

About

TypeScript library and CLI to manage CHANGELOG.md files

https://www.npmjs.com/package/protokollant

License:MIT License


Languages

Language:TypeScript 99.5%Language:JavaScript 0.5%