Giter Site home page Giter Site logo

Parse package.json about bundlephobia HOT 5 CLOSED

pastelsky avatar pastelsky commented on August 30, 2024
Parse package.json

from bundlephobia.

Comments (5)

shaun-sweet avatar shaun-sweet commented on August 30, 2024

actually you effectively have an endpoint of /package after forking your code. I'd like to piggy back on this and create a node command line utility that parses your package.json and gives you these values of the combined size of all your packages. If I submit for example react react-redux (which depends on react) and add them up, is that an accurate number for how big the both of them are in your project?

from bundlephobia.

pastelsky avatar pastelsky commented on August 30, 2024

Doing so has a couple of challenges -

  1. People often have non-front end dependencies in their package.json. So unless you allow them to select which packages to include, the results wouldn't be very helpful.

  2. Unless the cost packages are cached ( although a good number of popular packages are) the time taken to build and minify a large number packages can be too much (think about the time taken to run production webpack builds). So it kinda becomes like running a webpage test, and you have to build the support framework for queuing stuff and showing progress etc.

I'd be happy to know if you have workarounds, or would want to work on either.

from bundlephobia.

shaun-sweet avatar shaun-sweet commented on August 30, 2024

https://github.com/shaun-sweet/package-weight

here's what I made so far. I do think your first point could be an issue but perhaps I could put in an exclude flag into the utility. I guess your server would need to cache that info. Last I saw though it seemed you were using firebase to cache to avoid having to re zip and calc stuff?

from bundlephobia.

pastelsky avatar pastelsky commented on August 30, 2024

Hey @shaun-sweet. Despite of the caching, I don't think the heroku instance would be able to bear the load of multiple people scanning their package.json. There are just too many packages out there and they update quite frequently. The firebase cache is a lazy cache and unless we add queueing and get a better hosting, this will not work out.

I don't think exposing this as an API is a good idea atm with the current infrastructure.

from bundlephobia.

pastelsky avatar pastelsky commented on August 30, 2024

We now support scanning package.json from within bundlephobia.com (beta) Let me know what you think once you get your hands on.

from bundlephobia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.