Here's a quick proposal for something that I think would help npm packages (used as dependencies) be leaner, reducing burden of disk-space and bandwidth, especially for CI type setups which re-download tons of packages over and over again. My idea is inspired from Help People Consume Your npm Packages.
Add .npmignore-minimal
file with things in your package that are not-strictly-necessary (readmes, tests, etc) to filter out of minimal-package installs. npm install
still installs full package. npm min-install
(or npm install --production
) installs only the filtered down package contents (aka "minimal-package").
This proposal pairs/parallels devDependencies
, but extends this "optional" idea to your whole package structure.