In practice, you need to balance the overhead of an extra dependency with the benefits from sharing versions with others. When you add a dependency, you also now have a larger attack surface. Any extra dependency adds some amount of friction. Sometimes it is negligible. But, if you look at the overhead across all of your modules, it can add up quickly.
In some cases, the benefits from a dependency outweigh the overhead costs.
In other cases, you just write your own leftpad function and move on.
In practice, you need to balance the overhead of an extra dependency with the benefits from sharing versions with others. When you add a dependency, you also now have a larger attack surface. Any extra dependency adds some amount of friction. Sometimes it is negligible. But, if you look at the overhead across all of your modules, it can add up quickly.
In some cases, the benefits from a dependency outweigh the overhead costs.
In other cases, you just write your own leftpad function and move on.