GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Including the README/LICENCE within the package.json when doing an npm install causes there to be extra memory consumed when a module is required. The amount of excess memory being consumed depends on the size of each modules readme. This isn't a big deal, it's really more of an annoyance when looking at a core dump and having to see every packages readme in the output.
Is it possible to trim down the package.json when doing an install? Perhaps a --no-meta flag that strips out anything that isn't critical in the package.json when doing an install.
I see no reason to have readme included in package.json, and I even strip it in my private registry.
So, +1 for removing unless I missed a good reason to have it.
The historical reason for this is that read-package-json / normalize-package-data were used on both the client and registry sides, and the old web site code base pulled README data directly from CouchDB. You're absolutely right that there's no reason to have this included in the version of package.json that's written into node_modules. It would be excellent to come up with a blacklist of properties that should be stripped before writing those local manifests. I thought about whitelisting only the properties the CLI needs, but then I remembered that many packages in the ecosystem piggyback their configuration into package.json, and may need that at runtime, or at least during the run of lifecycle scripts at install / update time.
At the same time, this isn't something that the CLI team is going to have time to address within the medium term, and as such I'm going to close it. The patch-welcome label means that if somebody else wants to come along and take a shot at implementing this, we'll be happy to review it and work to get it landed. Thanks for your time!