24 days ago · Tech · 0 comments

I have been thinking a lot about npm dependencies lately, especially the small ones. Not the big libraries that solve hard problems, but the tiny packages that do one small thing: strip whitespace, pad a string, check a type, or format something simple. A good example is strip-indent, a small package that removes leading whitespace from each line of a string. If you open the source, it is not magic. It is a short function with a regex, a loop, and a replace. Useful, yes. But also the kind of thing many teams could probably own directly in their own codebase. The problem with "just install it"Installing a package became so easy that it often feels easier than creating a small utils/ file and writing the function ourselves. Need a helper? npm install. Need another helper? npm install. After a while, your project has hundreds of packages in the tree, and most people do not really know what half of them do. A tiny dependency feels harmless. The bundle size does not change much, the build…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.