For a given browserify bundle, lists all the dependencies in your
package.json which do not appear in that bundle. In large codebases this can be useful to find dependencies that are no longer relevant in production (i.e. for your legal teams).
Note: This works on dependencies through the entire bundle; for top-level dependencies you can use dependency-check.
#installnpm install -g unused-bundle-deps#use it like sobrowserify index.js | unused-bundle-deps -p
Example output with
-p (pretty) flag:
dependencies  ├── abs-svg-path ├── adaptive-bezier-curve ├── normalize-svg-path ├── svg-path-contours └── vec2-copy
unused(src, [opt], [cb])
Finds unused dependencies in
src (browser-pack bundle) by looking through your
"dependencies" of the closest
package.json file. Options can be:
cwdthe dir to search for pakage.json, defualt
filtera filter function for closest-package
Callback is called with
(err, unusedDeps) where
unusedDeps is an array of names like
[ "xtend", "lodash" ]. If there was an error reading the source bundle, finding the closest package, or reading it,
err will be non-null.
Usage: unused-bundle-deps [opts] < bundle.js Options: --pretty, -p pretty-print the results --cwd current dir to search for package.json
MIT, see LICENSE.md for details.