Well, we have a tool for that called vendoring, a.k.a. copy-pasting the library code into your repo. It’s no worse than copy-pasting LLM-generated code…
To me the disadvantage would be, the library likely does many more things than just what you need it for, so there is way more code, so you probably can’t realistically read and understand it yourself before incorporating it. This would lead to among other issues the main thing that irritates me about libraries; if it turns out something in it is broken, you are stuck with a much bigger debugging problem where you first have to figure out how someone else’s code is structured.
Although I guess that doesn’t apply as much to implementations of common algorithms like OP since the library is probably solid. I would consider favoring LLM code over most anything off npm though.
Well, we have a tool for that called vendoring, a.k.a. copy-pasting the library code into your repo. It’s no worse than copy-pasting LLM-generated code…
To me the disadvantage would be, the library likely does many more things than just what you need it for, so there is way more code, so you probably can’t realistically read and understand it yourself before incorporating it. This would lead to among other issues the main thing that irritates me about libraries; if it turns out something in it is broken, you are stuck with a much bigger debugging problem where you first have to figure out how someone else’s code is structured.
Although I guess that doesn’t apply as much to implementations of common algorithms like OP since the library is probably solid. I would consider favoring LLM code over most anything off npm though.