Identifies and removes extraneous packages from node_modules.
Compares the installed packages against the lockfile to find packages that are no longer needed.
Summary
Functions
Performs a dry run, returning what would be removed.
Calculates the total disk size of extraneous packages.
Finds extraneous packages in node_modules that aren't in the lockfile.
Removes extraneous packages from node_modules. Returns the list of removed entries.
Types
Functions
@spec dry_run(String.t(), map()) :: %{ to_remove: [prune_entry()], count: non_neg_integer() }
Performs a dry run, returning what would be removed.
@spec extraneous_size([prune_entry()]) :: non_neg_integer()
Calculates the total disk size of extraneous packages.
@spec find_extraneous(String.t(), map()) :: [prune_entry()]
Finds extraneous packages in node_modules that aren't in the lockfile.
@spec prune!(String.t(), map()) :: [prune_entry()]
Removes extraneous packages from node_modules. Returns the list of removed entries.