~kris/dots

srice

ref: e98f3b030dc24445bd55c68d95d2d81933fd68b3 srice/.local/bin/depsize -rw-r--r-- 388 bytes
e98f3b03 — Kris Yotam chore: sync local state after restore (push updates, no pull) a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh
# depsize -- show size of node_modules dependencies sorted by size
# Usage: depsize [path-to-node_modules]

nmdir="${1:-node_modules}"
[ ! -d "$nmdir" ] && { echo "No $nmdir directory found"; exit 1; }

echo "Top 20 largest dependencies in $nmdir:"
echo "---"
du -sh "$nmdir"/* 2>/dev/null | sort -hr | head -20
echo "---"
echo "Total: $(du -sh "$nmdir" 2>/dev/null | cut -f1)"