-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Display package size #219
Comments
Yes we could! We actually have downloaders that are able to download the source code as well as the published code: https://github.com/npms-io/npms-analyzer/tree/master/lib/analyze/download If there's a module that could receive a directory (that contains the code as well as the package.json) and calculate the bundle size, it would be easy to add the feature. |
@satazor Thanks for the response! I am actually working on code now to be able to do this but wanted to make sure I wasn't re-inventing the wheel! https://github.com/styfle/packagephobia I started going for a web app to make it similar to bundlephobia but really all it does is act as an API for the module you just described. Would you like me to break out the logic that computes the size into a separate package so you can save the size in your own database? |
Here's what I came up with: https://github.com/styfle/packagephobia |
@satazor The API is now available 🎉 You can use the npm package name and version (cached result): https://packagephobia.com/[email protected] Or simply the npm package name which will automatically use the latest version (never cached): https://packagephobia.com/api.json?p=next Will this work for npms.io to display a size? |
@satazor Do you want to call the API when building stats? |
I am considering writing a tool to do this because it might be outside the scope of this project.
There is already https://bundlephobia.com which is great for front end dependencies that get bundled with webpack but it doesn't tell you about the size of dev dependencies such as test frameworks.
There is already a request to add this to npmjs.com here: npm/www#197
Is this a feature that could be used by npms.io? (forgive me if this is the wrong repo)
The text was updated successfully, but these errors were encountered: