megahertz / howfat

Shows how fat is a package
MIT License
86 stars 8 forks source link

Add JSON repoter to support to read the command line output to reuse #18

Closed Chris2011 closed 1 year ago

Chris2011 commented 1 year ago

in any other application.

My use case is I want to add a graph of dependencies in a NetBeans plugin and I found your nice package. So I will use java to parse the json line and use it in my application. Maybe there is a need to rewrite the formatStats function because I want to use the extra information (filecount, deps, etc.) for different use cases.

megahertz commented 1 year ago

Awesome, thank you. Will add changes to collect extra information

megahertz commented 1 year ago

I've changed the final json structure (see README)

Chris2011 commented 1 year ago

Awesome thx :)

Chris2011 commented 1 year ago

The only thing that comes into my mind, as I can see your readme is that the json is formatted right in the console right? So I dunno whether this will still be handled as one line. If not, an option for -f (format) would be good to format it or not. But just guessing, didn't test it out yet.

megahertz commented 1 year ago

By default, it's printed as a plain json without whitespaces.

Chris2011 commented 1 year ago

Ah great, sry. As I said, I didn't test it yet, so next time, will do it earlier ;). BTW, thx for this project.