There are downsides to use package libraries as well. Like: 200mb hello world applications, or some companies restrict npm packages for security reasons.
Or, you just want to write code in notepad.exe. There is benefit to simplicity in many cases.
It's up to you to chose reasonable modules by reasonable developers. Notice I didn't call it a library, it's a 1kb module that has the code from the example + fixes you'd want anyway.