koajs / koa

Expressive middleware for node.js using ES2017 async functions

Home Page:https://koajs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

wojtekmaj opened this issue · comments

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.

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

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.

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

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.