NPM MODULE STATS

NPM MODULE STATS

Abraham Jagadeesh
Jul 29, 2017 · 2 min read

Most of the times, As a developer I am worried that the third-party modules are bloating my project and wished I could find the size of the module before I add to the project.

Later, I spent couple of nights and came up with this NPM module. This module gets the Exact compressed size of any NPM Module without installing/downloading it in your machine. The size recursively includes the size of its dependency tree till leaf.

Use cases

  • At some point, you want to keep your project as small as possible. However if the NPM modules that you use might increase the overall project size.
  • Just in case, if your are curious to know what are the dependent modules that will be downloaded with any NPM module.

Lessons Learnt

content-length: You don’t have to download a content to get its size.

Approximate G-zip compression ratio is 1:3

Aysnc/Await may remove lot of clutter in code

Array.indexof is faster than “in” operator

Retrying with https request

Abraham Jagadeesh

Written by

A passionate learner and an avid adaptor of modern front-end technologies.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade