Sometimes you just write enough code for the problems at hand and not go for a generic solution. And then the result is a few hundreds lines of code, instead of 10gb node-modules folder.
Like most things in life, the best answer for each situation is layered in nuance. There's a reason that it's such a meme for senior engineers to answer most questions with, "it depends."
> This issue is more prevalent in the rust and js ecosystem where instead of writing a few dozens line, the dev brings a whole library for that (almost everyone that uses chalk)
Here's some news: If you build your pretty native binary for your target operating system or the browser, you're using tens of millions of line of code.
For reference, my last job at an industry giant had a frontend-facing monorepo of a million lines or two.