Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

cleanup-dependencies

ugundeli369MIT0.0.6

clean up unused dependencies

nodecli, cli, package, package.json, dependency, command line, dependencies, trim, unused, clean, remove, delete, command, commandcli, command cli, node, modules, node_modules

readme

cleanup-dependencies

"clean-deps" is a node CLI command to cleanup un-used node dependencies

Installation

npm install cleanup-dependencies

Usage

Your node project's package.json might have some un-used dependencies listed, which, if not removed, will be downloaded and packaged as part of your node component during build time.

to find and remove unused deps :

  1. CD into your project folder and
  2. execute "clean-deps"

Example


package.json [BEFORE] :
{
  "name": "some-node-component",
  ...
  ...
  ...
  "dependencies": {
    "underscore": "*",
    "array-uniq": "*",
    "fs-extra": "*",
    "jsonfile": "*",
    "process": "*",
    "jsonupdate" : "*",
    "abcd" : "*",
    "xyz" : "*"
  },
  ...
  ...
  ...
}

==> $clean-deps 
// will identify the dependencies that are actually used and only keep them. 
// package.json will be automatically be updated as shown below.

package.json [AFTER] :
{
  "name": "some-node-component",
  ...
  ...
  ...
  "dependencies": {
    "underscore": "*",
    "fs-extra": "*",
    "jsonfile": "*"
  },
  ...
  ...
  ...
}