npm-prune
Remove extraneous packages from node_modules. tldr-pages
On several platforms
Several platforms
Remove extraneous packages from node_modules. Note: Extraneous packages are those present in the node_modules folder that are not listed as any package's dependency list.
Remove all extraneous packages not listed in dependencies
npm pruneIdentifyRemove extraneous packages and devDependencies (useful for production builds)
npm prune --productionIdentifySimulate pruning, showing what would be removed without making any changes
npm prune --dry-runIdentifyOutput the changes as JSON
npm prune --jsonIdentifyRemove specific packages by name
npm prune package_nameIdentify