Patching a library is fine if you’re building a final executable — something where you know what the final dependency graph looks like ahead of time.
It’s not fine if you’re building a library. You don’t know if a consumer will also want to use an unpatched version of that library, and depending on the scenario that could result in duplicated instances (each with their own internal state), failure to build or load, or mismatches in data layout or function definitions.
I would avoid using a library like that if I could.
Of course, sometimes the person who can make that decision is the creator of npm itself, and says “No I don’t believe I will”: https://github.com/isaacs/jackspeak/issues/20





Whatever specific class I am, my play style is definitely “glass cannon”.