DEV Community

Cover image for Things to look for while picking a library
roix
roix

Posted on

Things to look for while picking a library

Many times we come across the scenario where we need to pick a library to implement a feature. We usually have our go-to library in our mind in most of these cases.

But in some cases, we will have to do some research on the available libraries and pick one of the available ones.

Here are some things (in no particular order) you should look for while picking a library.

1. Popularity

The more popular a library is, the more people would be using it. That means there is a large user community using the library every day and that comes with the following benefits:

  • Fewer bugs as most would be already reported by the users and fixed.
  • More questions and answers on Stackoverflow (and more search results on Google).
  • Better documentation.
  • Less chance that the library has some serious performance issues or missing any important features.

I use the following metrics to decide how popular a library is:

  • Github stars - I look for libraries having more than 1.5k stars.
  • npm weekly downloads (for javascript libraries) - I look for libraries with 6 figure weekly npm downloads on npm.

2. Last Release / Last Commit

Another thing to consider is how recently a new release was made for the library.

If the repository is publicly available then you should also check when was the last commit made to that repository and how often commits are being made in that repository.

A library may be popular, but if it is not maintained anymore then it may become outdated or have bugs that will never be fixed.

More frequent releases or commits means that the contributors/maintainers of the library are actively working on pushing important security/bug fixes or new features.

It also means that if you find a serious bug or a very useful feature missing, you can request the developers to fix or implement them or you can directly contribute to the code if the library is open source.

3. Library Size

Another thing to look for is the size of the library.

More often than not, as a library gets popular, more and more features get added to it. This increases the size of the library.

If you just want a very small subset of the features the library provides, then you can pick a library that has all the features you need and has a smaller footprint.

Top comments (0)