Sometimes you just feel like giving the users of your product something extra. This was the case with letting the users know about the current name day. Unfortunately, there are not many public APIs that would provide the desired functionality, even less with the support of your country. Luckily though, there is a guy named Vojtěch Nekvapil who had also felt that this API is missing and so he built one. It is called International nameday API and it’s available here.
I used his API in my code and it worked perfectly. Another day, as it happens in programming, there was an issue indirectly related to the nameday API. I felt helpless that day so I tried to contact Vojtěch. To my surprise, he replied within hours and we started to talk (in the meantime, I fixed the issue on my own). A bit later, he asked me to build a wrapper written in JavaScript around his API to make it easier to use for JavaScript developers as he was a PHP developer and had no or little knowledge of JavaScript.
Up until then, I’ve never built any JavaScript library nor written any other open-source software and I thought of this to be a good opportunity to enter the open-source world because the library didn’t seem that difficult to build. I started by learning how to build an NPM package as this is the biggest code package ecosystem in the world. Since the beginning, I also wanted to incorporate TypeScript support because I know how much it helps developers to use a third-party library.
In essence, I created some methods that internally call the nameday API and then return the results to developers directly. It saves developers some writing because they don’t need to manually fetch data from different endpoints anymore.
The documentation of how to use the library is available here. Contributing to the open source is only beneficial. You can be listed as a contributor like so and you get to write articles like this. Highly recommended!