Split "lib" utilities into npm packages?
phated opened this issue · comments
We have a few utilities that I think could benefit being on npm. Such as stripTrailingSlashes
and cloneBuffer
Thoughts? cc @contra
Not sure if we want to increase the dependency count, etc.
@phated Seems like overkill + more overhead to maintain. We should look to see if we can replace anything in lib with existing modules though - there has to be a clone buffer, is buffer, is null, etc. that we can rely on instead of rolling our own.
On second look, most of these can be straight up scrapped - we're only using some of them in one place. For example, isNull is only being used once in this whole project:
Line 66 in a6da597
== null
works.I agree. Sadly there isn't a buffer cloning utility. I was thinking about splitting that out.
@contra there's actually a new/proper way to clone in node 5.something+ - Buffer.from(buff)
. I was thinking about combining both strategies into a utility module.
I've removed the utility methods that made sense to use external modules. The only module I personally split out was clone-buffer
.