I am using a NodeJS library, Eris, quite extensively. Since it represents the main structure of my bot, I tied a number of (singleton) objects and functions to it (e.g. database and logger reference, custom command for sending message, etc.).
The first question here is whether this is reasonable design, which I think is justified by removing items from the global scope (please do correct this assumption if this is bad practice in JS). The second question becomes, should I just extend the class offered by the library to "inherently" include these functionalities? Or is some other solution better (i.e. attaching objects once the class is instantiated, just using globals, creating a separate class that gets passed around and handles these functionalities, etc.)?