DEV Community

Clement134
Clement134

Posted on

Introducing get-changelog v2

πŸ” What is get-changelog

get-changelog (⭐ https://github.com/Clement134/get-changelog) is a collection of tools to easily find changelog files from npm packages.

Sadly at the moment there is no official way to specify location of a changelog file in an npm package. The most common way is to read CHANGELOG.md file in the root directory of the project. But some packages use other files or even github releases.
The purpose of these tools is to handle all these exceptions and return the url of the changelog file.

New features

This new release focus on three keywords: ⌚ performance, 🎯 accuracy and πŸ’» user experience.

⌚ Better performance

The main purpose of this tool is to reduce manual finding so performance is very important.

In the library many http request are tried to check every possible location. By performing head requests instead of get we have achieved a performance boost of 30%.

Additionally, in the previous versions some files in the txt format were analyzed. But after analysis of the changelog files of the 1000 most popular npm packages (more on that in a next article) we found that usage of those files were very uncommon compared to the analysis cost. So we have decided to analyze txt files only if the --txt option is provided. It could result in x2 speed up for packages using github releases.

🎯 Increased accuracy

Due to the diversity of the possible changelog file names, it's not trivial to find the changelog file of a project. By analyzing the 1000 most popular npm packages we have managed to add 60 exceptions for popular packages (exception file).

To grow up this list and keep it up to date we also added a link in the console reporter to fill a new issue for wrong changelog location.

issue-suggestion

We also added support for gitlab hosted packages.

πŸ’» Improved user experience

Some new features have been added to the console reporter such as a new table visualization or the sort of updates by order of importance.

check-example

We also reduced the needs of github token making the tool work without it (but without default branch detection and github release verification).

Conclusion

I learned a lot working on this new release and I hope it will be useful for some of you.
If you have ideas to improve these tools feel free to add a comment or write an issue in the project.

I am also curious to know if some of you ever struggle finding changelog files?

Top comments (0)