@r0mflip/logtag

0.6.0 • Public • Published

logtag

Generate releases/changelog/history file from tags(default)/releases of a GitHub repo.

The output file is written in markdown and commit messages are used for tags.

The CHANGELOG.md in this repo is generated by using logtag from the releases.

Installation

$ npm i -g @r0mflip/logtag

Usage

$ logtag --repo expressjs/express \
    --token <GitHubAccesToken> \       # Personal access token for GitHub API
    --out <OutputFile>.md \            # Output to file, default is stdout
    --releases                         # Use GitHub releases instead of git tags

Options

  • --repo <repo> Specify repo in <scope>/<repo> format (-r)
  • --token <token> - GitHub access token (-t)
  • --out <file> - Save formatted markdown output into file (-o)
  • --releases - If specified gets info from releases instead of tags
  • --noempty - Skip entities with empty or same body as release name (-n)

Note: Equivalent of --noempty is not available programatically

API

// CJS
const logtag = require('@r0mflip/logtag');

// ESM
import logtag from '@r0mflip/logtag';


// logtag is an AsyncGeneratorFunction
// which returns an AsyncGenerator
const tagSpitter = logtag({
  repo: 'expressjs/express',
  token: '<GITHUB_TOKEN>',
  releases: false,
});

(async _ => {
  for await (const tag of tagSpitter) {
    // Use tag of type
    AsyncGenerator<{
      name: String;
      author: String;
      prerelease: Boolean;
      date: String;
      body: String;
    }, void, unknown>
  }
})();

Know more about Asynchronous generators

LICENSE

MIT

Package Sidebar

Install

npm i @r0mflip/logtag

Weekly Downloads

28

Version

0.6.0

License

MIT

Unpacked Size

13.6 kB

Total Files

8

Last publish

Collaborators

  • r0mflip