koajs / koa

Expressive middleware for node.js using ES2017 async functions
https://koajs.com
MIT License
35.07k stars 3.22k forks source link

Consider alternatives to http-assert (including none at all) #1778

Closed wojtekmaj closed 7 months ago

wojtekmaj commented 10 months ago

http-assert targets very old Node.js version (0.8) and thus includes bloated deep-equal dependency that can be, for example, replaced with a much smaller alternative dequal. http-assert itself is just a few lines really so I would argue copying these lines over and replacing deep-equal with dequal would be beneficial, improving install size and install time.

siakc commented 7 months ago

Why the sizes listed in npm differs this much with packagephobia?

wojtekmaj commented 7 months ago

Quoting their README:

The "install size" is the size your hard drive will report after running npm install. This includes the package, all of the dependencies, and its dependency's dependencies...and so on.

siakc commented 7 months ago

Size on disk: deep-equal: 3.2M dequal: 60K

iwanofski commented 7 months ago

Installation size isn't necessarily a metric Koa is tracking or cares too much about. A clean install of Koa is sub 2mb which in "node_modules theory" is considered negligible. For this reason alone http-assert will not be replaced.