~kris/dots

srice

ref: f5fc91419850ee5f2652bdce0dcc214de18b4a22 srice/.local/bin/depsize -rwxr-xr-x 388 bytes
f5fc9141 — Kris Yotam add wallpapermenu script (was untracked); auto-detect output so cw works on any machine 3 months 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)"