A Unix Tree command - but for S3!

I was trying to visualise some S3 buckets for a cost optimisation exercise and wanted to be able to run a Tree command on it, obviously thats not a thing the Unix command can do … and I've been playing with JavaScript recently.