3 ms·
Shouldn't this be handled entirely by npm? If these files are unnecessary why do they get downloaded in the first place?
by sergiotapia 9y ago
Shouldn't this be handled entirely by npm? If these files are unnecessary why do they get downloaded in the first place?
- tjholowaychuk 9y agoIdeally people use the "files" array. It might be nice if someone writes a bot to go around and fix large packages by adding that.
- exogen 9y agoMany authors are strangely against it for some reason. One time I sorted my node_modules by size and opened issues for the top offenders, you can see their resistance here: https://github.com/crypto-browserify/sha.js/issues/5 https://github.com/crypto-browserify/sha.js/issues/5 https://github.com/medikoo/es5-ext/issues/11 https://github.com/medikoo/es5-ext/issues/11
- yorwba 9y agoSpeaking as very-much-not-a-JS-developer: Isn't this essentially the same problem Linux package managers solve with -dev, -doc, and -dbg packages? I.e. the default install only contains the minimum necessary to use a program, and if you need the header files/documentation/debug symbols, you can just install them separately. Is it too hard to meaningfully separate these parts of a package, or is it more of a philosophical issue?
- krisdol 9y agoIt really is not too hard to separate these things in npm, but very few packages do.
- SilasX 9y agoWhat gave you a reason to believe npm was well-architected?
- wildpeaks 9y agoIt's more an issue with the modules authors, npm already has a documented way to exclude files from being published. Furthermore, it would be quite irritating if it started assuming specific file extensions are forbidden instead of using the explicit list provided by the author.
- finchisko 9y agoNo it should NOT be handled by npm. Imagine some npm project really needs those files. Like module that is rendering markdown files to html. If npm would be that "smart" to strip your .md files, you would be pissed and blame npm. NPM is awesome as is. It's developer responsibility to write proper .npmignore, because only him/her knows what can be excluded.
- twhb 9y agoSee my top-level comment. It should be handled by library authors, and npm does provide the tooling to do it, but most authors choose to include the files. Seems to be a difference of principle.
- deleted 9y ago[deleted]