7 ms·
Absolutely! Here’s one I found very useful just the other day, client-zip: https://github.com/Touffy/client-zip#usage https://github.com/Touffy/client-zip#usage
by iainmerrick 3y ago
Absolutely! Here’s one I found very useful just the other day, client-zip: https://github.com/Touffy/client-zip#usage https://github.com/Touffy/client-zip#usage
(Three functions rather than one, but it’s one main entrypoint and a couple of minor variants.)
I think this is a really well-designed API, and greatly preferable to a more fine-grained OO approach. It does a lot of work under the hood but keeps it carefully contained so you don’t get a bunch of dependency sprawl.
- crabmusket 3y agoThe API may be a single function, but that package contains a non-trivial amount of code. The contribution this package makes to your codebase is not "a single function". However, at a glance, I agree with your reasons for liking it! And I'd be unlikely to vendor it directly into an app or dependent library for example. EDIT: it feels to me like the CRC32 implementation contained in that library is a prime example of what the original article had in mind. There should be one global CRC32 function which every person could pull and reuse, instead of bundling it with their own package!