Add package size to each line
styfle opened this issue · 5 comments
I would like to suggest adding the package size to each line.
It could just simply be a badge that gets the size in real time, see Package Phobia.
For example:
- is-sorted - A small module to check if an Array is sorted.
- array-first - Get the first element or first n elements of an array.
@parro-it Thoughts?
Yes, it could be interesting, but it will complicate adding new entries to the list, while I want to keep that process really simple: every time I found an interesting micro-package, I quickly add it here.
It will not complicate it, I've already done all the work to calculate the size.
You just add a link to the image like so:
https://packagephobia.now.sh/badge?p=is-sorted
https://packagephobia.now.sh/badge?p=array-first
Read more here: https://github.com/styfle/packagephobia
@styfle, i think there is a problem behind your idea, you're measure the size of the package but at the end of the day i want to know how big is the size of the file is i will include in my project, if you're using badgesize and jsdelivr you can figure out this information:
http://img.badgesize.io/https://cdn.jsdelivr.net/npm/is-sorted/index.js
http://img.badgesize.io/https://cdn.jsdelivr.net/npm/array-first/index.js
With this way you will also only measuring the files in the npm package - if you're using some kind of a minifier in your project you will reduce the size anyway.
But i like the idea to show a information like that in a repo, if its making the list confusing has @parro-it to decide.
@michaelzoidl Yea I agree with you if we’re talking about packages that run in the browser (there is actually a Broswer section in the readme). However, Package Phobia exists because many packages do not run in the browser (see the File System section of the readme).