How to upgrade to npm packages with breaking changes?
07 Oct 2021
This was my first blog about tech.
I had to upgrade the mongodb npm package in our code base from version 2.2 to 3.6. Between these releases ES6 had released and async, await were introduced. Newer packages of the versions were released with the cleaner async methods instead of using callback functions. The 2.2 version used callbacks and the 3.6 version had an async API. To make matters worse, the package was used haywire everywhere in the code base which required that I change every file where this package was required.
I learnt my lesson the hard way and introduce you to the best practices I follow when working with npm packages, because Breaking Changes will arrive unannounced on a Red Carpet.