https://github.com/zikani03/dujar
Basically du for .jar files - peak inside a jar file and see the sizes of the resources in the jar
https://github.com/zikani03/dujar
du java kotlin toy-project
Last synced: 4 months ago
JSON representation
Basically du for .jar files - peak inside a jar file and see the sizes of the resources in the jar
- Host: GitHub
- URL: https://github.com/zikani03/dujar
- Owner: zikani03
- License: mit
- Created: 2021-07-08T00:46:52.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-12T08:12:48.000Z (almost 5 years ago)
- Last Synced: 2025-07-08T03:41:56.244Z (11 months ago)
- Topics: du, java, kotlin, toy-project
- Language: Kotlin
- Homepage:
- Size: 3.77 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
dujar
=====
> My first ever Kotlin thingie, yay! 🥳
Basically `du` for .jar files - peak inside a jar file and see the sizes of the resources in the jar
It is still early days and I'd like it to get it to work something like [goweight](https://github.com/jondot/goweight) with the JSON output and all.
Also needs more and actual command-line arguments and maybe even a kotlin-native build.
## Why?
I needed something like this at work and also needed a good reason to learn Kotlin.
**Example output**
Ran it on a build of [zefaker](https://github.com/creditdatamw/zefaker), oof - those YAMLs takin up space huh.
```
$ java -jar dujar.jar zefaker-all.jar
1.4 MiB en-US.yml
1.0 MiB org/codehaus/groovy/runtime/ArrayUtil.class
937.8 KiB groovyjarjarantlr4/v4/unicode/UnicodeData.class
526.3 KiB org/apache/poi/sl/draw/geom/presetShapeDefinitions.xml
507.2 KiB org/apache/poi/xssf/usermodel/presetTableStyles.xml
504.7 KiB org/apache/groovy/util/Maps.class
356.2 KiB nl.yml
...TRUNCATED...
```
## Building
Assuming you have the Kotlin compiler on your PATH
```sh
$ kotlinc dujar.kt -include-runtime -d dujar.jar
```
## Running
```sh
$ java -jar dujar.jar /path/to/file.jar
```
---
Copyright (c) Zikani Nyirenda Mwase