Skip to main content

Description

Calculates and displays the size of node_modules folders in the current directory and subdirectories. Sizes will be smaller than actual file size taken on disk. The tool calculates actual file size rather than file size on disk (related to disk blocks usage).

Usage

rev-dep node-modules dirs-size [flags]

Examples

# Calculate node_modules size in current directory
rev-dep node-modules dirs-size

# Calculate size in a specific directory
rev-dep node-modules dirs-size --cwd=/path/to/project

# Calculate sizes across a monorepo
rev-dep node-modules dirs-size --cwd=/path/to/monorepo

Flags

-c, --cwd
string
default:"$PWD"
Working directory for the command
-h, --help
boolean
Help for dirs-size

Use Cases

Disk Space Management

Understand how much disk space your node_modules directories are consuming.

Monorepo Analysis

Calculate the total size of all node_modules directories in a monorepo.

Pre-Optimization Measurement

Measure size before running deduplication to quantify potential savings.
The reported size is the actual file size, not the disk space used (which accounts for block allocation). The actual disk usage may be higher.

Build docs developers (and LLMs) love