Wondering what’s next for npm?Check out our public roadmap! »

    ghtags

    0.8.0 • Public • Published

    ghtags

    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 ghtags from the releases.

    Installation

    $ npm i -g ghtags

    Usage

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

    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 [uses tags by default]
    • --noempty - Skip entities with empty or same body as release name (-n)

    Note: Equivalent of --noempty and --out are not available programatically

    API

    const getTags = require('ghtags');
     
    // getTags is an AsyncGeneratorFunction
    // which returns an AsyncGenerator
    const tagSpitter = getTags({
      repo: 'expressjs/express',
      token: '<GITHUB_TOKEN>',
      releases: false,
    });
     
    (async _ => {
      for await (const tag of tagSpitter) {
        // Use tag of type
        AsyncGenerator<{
          url: String;
          name: String;
          author: String;
          prerelease: Boolean;
          date: String;
          body: String;
        }, void, unknown>
      }
    })();

    Know more about Asynchronous generators

    LICENSE

    MIT

    Install

    npm i ghtags

    DownloadsWeekly Downloads

    2

    Version

    0.8.0

    License

    MIT

    Unpacked Size

    10 kB

    Total Files

    5

    Last publish

    Collaborators

    • avatar