Output recursive directory stats as JSON for visualization and analysis.