npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

extract-changelog-release

v1.0.2

Published

Extract release notes from latest entry in standard-version changelog

Downloads

17,022

Readme

extract-changelog-release

npm version Build Status Conventional Commits

Extract release notes from latest entry in standard-version changelog.

This project can be used for automating GH releases with standard-version — see GH Actions example.

Usage

CLI

# Extracts from CHANGELOG.md in the current working directory
npx extract-changelog-release

# Extracts from package/CHANGELOG.md relative to CWD
npx extract-changelog-release ./package/CHANGELOG.md

# Extracts from absolute path /path/to/LOG.md
npx extract-changelog-release /path/to/LOG.md

Example Result

$ extract-changelog-release
## [3.2.0](https://github.com/LeDDGroup/typescript-transform-paths/compare/v3.1.0...v3.2.0) (2021-08-03)

### Features

* Support transformation via ts-node transpileOnly and compiler API transformNodes (closes [#123](https://github.com/LeDDGroup/typescript-transform-paths/issues/123)) ([dd942fd](https://github.com/LeDDGroup/typescript-transform-paths/commit/dd942fdbf34afcdec8f976a1540746521a758c73))

### Bug Fixes

* Custom JSDoc tags not working for older TS (fixes [#126](https://github.com/LeDDGroup/typescript-transform-paths/issues/126)) ([d4280c3](https://github.com/LeDDGroup/typescript-transform-paths/commit/d4280c3dec4dc9f3834fc98be2e51109422bd9aa))

Programmatic

import { extractLog } from 'extract-changelog-release';

let releaseNotes: string;

// Extracts from CHANGELOG.md in the current working directory
releaseNotes = extractLog(); 

// Extracts from package/CHANGELOG.md relative to CWD
releaseNotes = extractLog('package/CHANGELOG.md'); 

// Extracts from absolute path /path/to/LOG.md
releaseNotes = extractLog('/path/to/LOG.md');

GH Actions

Example config

The following action is triggered when a new version tag is pushed. It will:

  • Build
  • Test
  • Publish to NPM
  • Create a GitHub Release based on the latest entry in CHANGELOG.md

.github/workflows/publish.yml

name: Publish

on:
  push:
    tags:
      - v*.*.*

jobs:
  publish:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup Node.js 14.x to publish to npmjs.org
        uses: actions/setup-node@v1
        with:
          node-version: '14.x'
          registry-url: 'https://registry.npmjs.org'

      - name: Install Packages
        run: yarn install --frozen-lockfile

      - name: Build
        run: yarn build

      - name: Test
        run: yarn test
        env:
          CI: true
          
      - name: Generate Release Body
        run: npx extract-changelog-release > RELEASE_BODY.md

      - name: Publish to NPM
        run: npm publish
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
        
      - name: Create GitHub Release
        uses: ncipollo/release-action@v1
        with:
          bodyFile: "RELEASE_BODY.md"
          token: ${{ secrets.GITHUB_TOKEN }}