megahertz / howfat

Shows how fat is a package
MIT License
86 stars 8 forks source link

add field sizeOnDisk? #23

Open vogler opened 1 year ago

vogler commented 1 year ago

It would be nice to have another field that shows the size on disk of a package in node_modules as there can be quite big differences:

$ howfat picocolors
picocolors@1.0.0 (5.52kb, 7 files, ©ISC)
$ du -sh node_modules/picocolors
28K node_modules/picocolors

https://www.npmjs.com/package/picocolors shows 5.66kB for 'Unpacked Size' - I don't know what data howfat uses.

This is of course only possible if the package is installed locally. The size on disk could be shown by default when running

megahertz commented 1 year ago

I have no plans for that at least in the near future.

That's a good point about different size in howfat and on npm. Actually, howfat divides size by 1024. It would be nice to use 1000 bytes per kilobyte or use "kib" instead of "kb" in the output, I haven't decided yet which option is better.