tj / commander.js

node.js command-line interfaces made easy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove README.md from bundle

H4ad opened this issue · comments

By NPM itself is impossible to remove, pack command will always include the Readme.md in the bundle, but maybe we can use another tool to pack or just try to reduce the size of the Readme by splitting the documentation in another file.

This change can save 25% of the bundle size, from 177kb to 134,7kb, saving up to 4,3TB/week of bandwidth.

I have wondered about this sometimes, but the size is reasonably small in the overall scheme of things, and caching can eliminate the download entirely as a global approach. And no one has complained recently. :-)

npm decided long ago to always include the README, I am guessing so available offline, or so always available on the npm package page (or both).

Have you seen other packages that deliberately have a placeholder README for their npm packages?

but the size is reasonably small in the overall scheme of things

Looking for the size alone is small, but this library has so many downloads that even a tiny change can have a huge impact.

caching can eliminate the download entirely as a global approach

Caching helps but doesn't eliminate the bandwidth spent on the user side to download the package.

Have you seen other packages that deliberately have a placeholder README for their npm packages?

To be honest, I never saw it, I was just looking for the top download libs on NPM and seeing what I could do to optimize the bandwidth, the easiest approach was to look at the heaviest files, and README.md is one of them.

I think for this library a placeholder could be worthy since the README is really heavy (25% of the lib), but I'm not sure about what should go on the placeholder, I added a proposal on #2058.

Related discussion about npm treatment of README with some higher level approaches proposed: npm/rfcs#744

There wasn't concern expressed by npm folks about README bandwidth in npm/rfcs#744 and the README does get displayed in a number of other contexts. I am subscribed to that issue for updates.

There hasn't been further activity in a month. Closing this as resolved.

Feel free to open a new issue if it comes up again, with new information and renewed interest.