JConfig is a simple library made to help with storing and retrieving data from a json file in Java and Kotlin.
For example, say you are making a discord bot and you want to store the token in a json file, you can do this:
- create a config.json file in the root of your project. If you want you can change the files name, but I will shows you how to do it with the default name.
{
"token": "YOUR_TOKEN_HERE"
}
- We know need to get the token, so we will use JConfigUtils which has a standard builder.
val token = JConfig.build()
.get("token")
.asText()
And thats it for getting the token.
<dependency>
<groupId>io.github.realyusufismail</groupId>
<artifactId>jconfig</artifactId>
<version>1.1.1</version>
</dependency>
//kotlin
dependencies {
implementation("io.github.realyusufismail:jconfig:1.1.1")
}
//groovy
dependencies {
implementation "io.github.realyusufismail:jconfig:1.1.1"
}
See the wiki
Just make a pr and wait for it to be reviewed.