The key thing needed is a standard library which includes 100000 of these tiny one function libraries (has-ansi, color-name).
I don't know anything about the npm ecosystem, what's the benefit of importing these libraries compared to including these code in the project?