Skip to content

timoxley/pkgcount

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pkgcount

Easily see how many packages, which versions and how many copies of each package are installed in your node_modules hierarchy.

Installation

npm install -g pkgcount

Usage

> pkgcount --help

  Usage: pkgcount [options]

  Options:

    -h, --help         output usage information
    -V, --version      output the version number
    -m, --min [count]  only list packages duplicated at least this number of times
    -d, --duplicates   only list packages appearing more than once
    -D, --du           show disk usage
    --json             display json output
    --no-color         display uncolored output. Colors indicate packages with high levels of duplication
    --paths            list paths to each package instead of counts
    --summary          only display summary
    --depth [depth]    limit traversal depth
    -s, --sort [key]   Sort results by (name|duplicates|size) [duplicates]

By default, pkgcount uses coloured output as a simple visual aide to help identify packages with high levels of duplication. Packages are shaded from yellow->red based on the number of duplicates.

Examples

List All Packages

timoxley/pkgcount

List Only Duplicates

substack/node-browserify

List Only Summary

mikeal/request

pkgcount --summary


PKGCOUNT SUMMARY
Total Pkgs      94
Unique Pkgs     86   91%
Duplicate Pkgs  8    9%
Max. Depth      6

JSON Output & No Color Highlighting

All commands accept these flags.

> pkgcount --summary --json --no-color

List Paths to Packages

Similar to npm ls --parseable.

chjj/marked

> pkgcount --paths

PACKAGE           paths
[email protected]
[email protected]  node_modules/robotskirt
[email protected]    node_modules/showdown
[email protected]    node_modules/markdown
[email protected]        node_modules/markdown/node_modules/nopt
[email protected]      node_modules/markdown/node_modules/nopt/node_modules/abbrev

PKGCOUNT SUMMARY

Total Pkgs      6
Unique Pkgs     6    100%
Duplicate Pkgs  0    0%
Max. Depth      3

Limit Traversal Depth

> pkgcount --depth=1

PACKAGE           #
[email protected]      1
[email protected]  1
[email protected]    1
[email protected]    1

PKGCOUNT SUMMARY
Total Pkgs      4
Unique Pkgs     4    100%
Duplicate Pkgs  0    0%
Max. Depth      1

See Also

License

MIT

About

Produce a report on number of duplicate packages in node_modules.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •