Skip to content

Simple Kotlin MPP module for serializing/deserializing a package.json

License

Notifications You must be signed in to change notification settings

sugarmanz/package-json

Repository files navigation

package.json

Simple Kotlin MPP module declaring NPMs package.json as a Kotlinx Serializable structure.

Gradle Dependency

implementation("com.sugarmanz.npm:package-json:$version")

Basic Usage

Parsing a package.json:

val myPackage: PackageJson = Json.decodeFromString("""
{
  "name": "my-package",
  // ...
}
""")

Adding a dependency:

myPackage.dependencies.add("name", "0.0.0")

Writing back to JSON:

Json.encodeToString(myPackage)

About

Simple Kotlin MPP module for serializing/deserializing a package.json

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages