kotlin-lib
A general-purpose multiplatform library. Implemented in Kotlin, usable also from Java, JavaScript/TypeScript and more.
Note however that due to the current nature of Kotlin Multiplatform, many parts of the library are not available from regular JavaScript/TypeScript projects.
Usage with JVM
You can use this library with any language that runs on the Java Virtual Machine: Java, Kotlin, Scala etc.
The build artifacts have been published to the Maven Central repository.
Maven
<dependency>
<groupId>com.marcoeckstein</groupId>
<artifactId>kotlin-lib-jvm</artifactId>
<version>${version}</version>
</dependency>
Gradle (Kotlin DSL)
implementation("com.marcoeckstein:kotlin-lib:$version")
Gradle (Groovy DSL)
implementation 'com.marcoeckstein:kotlin-lib:$version'
Usage with Kotlin Multiplatform
Use the same snippets as for a Gradle JVM project (see above).
Usage with JavaScript/TypeScript
npm install --save @marco-eckstein/kotlin-lib@$version
import * as kotlinLib from "@marco-eckstein/kotlin-lib";
# Kotlin multiplatform exports full namespaces:
const klib = kotlinLib.com.marcoeckstein.klib
klib.kotlin.stringify(undefined)
Usage with C, Objective-C etc.
I do not actively support this, but you should be able to build native binaries of this project yourself using Gradle. Please see the Kotlin Multiplatform docs.