- Home
- Code Transpilers
- Kotlin/JS
Kotlin/JS
What it is
Kotlin/JS is a Kotlin compiler target that translates Kotlin code, the Kotlin standard library, and compatible dependencies into JavaScript. Projects can target browsers or Node.js, including server-side and serverless applications. It supports ES5, ES2015, and ES2020 output, plus ESM, CommonJS, UMD, and AMD module formats. Configuration uses the Kotlin Multiplatform Gradle plugin, which supports bundling settings and JavaScript dependencies from npm. Kotlin/JS can share common logic between web frontends and JVM backends, or among Android, iOS, and web clients. Kotlin wrappers are available for React and other JavaScript frameworks, including React Redux, React Router, and styled-components. Browser tests can use Karma or an experimental browser testing DSL; Node.js projects use Mocha. The documentation notes that Karma is deprecated and is not expected to receive new features or bug fixes. The Gradle plugin generates JavaScript source maps for builds. Kotlin/JS is open source and free, and is listed for Linux, macOS, web, and Windows.
For and against
For
- Targets browsers and Node.js.
- Supports four JavaScript module systems.
- Can share logic across listed client and backend targets.
- Gradle builds generate JavaScript source maps.
Against
- Karma is deprecated and will not receive new features or fixes.
- Browser testing DSL is experimental.
The verdict
Kotlin/JS offers several JavaScript targets and project integrations for Kotlin developers. Browser testing choices include an experimental option, while the documentation cautions that Karma is deprecated.
Who it suits
Kotlin/JS suits developers building web frontends in Kotlin or sharing business logic with JavaScript or TypeScript codebases. It also supports teams targeting Node.js applications.
Plans and prices
Kotlin/JS
Kotlin compiler target for JavaScript; configured with the Kotlin Multiplatform Gradle plugin
Read 29 Sep 2026 · kotlinlang.org
On the record
- Code sharing
- Kotlin/JS can share common logic between web frontends and JVM backends, and between Android, iOS, and web clients.kotlinlang.org · read 29 Sep 2026
- Debugging
- The Kotlin Multiplatform Gradle plugin automatically generates JavaScript source maps for project builds.kotlinlang.org · read 29 Sep 2026
- ECMAScript targets
- The current Kotlin/JS implementation targets ES5, ES2015, and ES2020.kotlinlang.org · read 29 Sep 2026
- Environments
- Kotlin/JS projects can target browsers or Node.js.kotlinlang.org · read 29 Sep 2026
- Gradle setup
- Kotlin/JS is configured through the Kotlin Multiplatform Gradle plugin, which supports bundling configuration and JavaScript dependencies from npm.kotlinlang.org · read 29 Sep 2026
- Integrations
- JetBrains provides Kotlin wrappers for React and other JavaScript frameworks, including support for React Redux, React Router, and styled-components.kotlinlang.org · read 29 Sep 2026
- Intended users
- The documentation describes Kotlin/JS use cases including web developers sharing business logic with JavaScript or TypeScript codebases and developers building web frontends in Kotlin.kotlinlang.org · read 29 Sep 2026
- JavaScript modules
- Kotlin/JS supports ESM, CommonJS, UMD, and AMD module systems.kotlinlang.org · read 29 Sep 2026
- Purpose
- Kotlin/JS transpiles Kotlin code, the Kotlin standard library, and compatible dependencies to JavaScript.kotlinlang.org · read 29 Sep 2026
- Server-side use
- The Node.js target supports server-side or serverless applications, and kotlinx-nodejs provides type-safe access to the Node.js API.kotlinlang.org · read 29 Sep 2026
- Support
- The Kotlin documentation directs users to the #javascript channel in Kotlin Slack to discuss Kotlin/JS with the community and team.kotlinlang.org · read 29 Sep 2026
- Testing
- Kotlin/JS supports browser tests through Karma or a new experimental browser testing DSL, and uses Mocha for Node.js projects.kotlinlang.org · read 29 Sep 2026
- Testing limitation
- The Kotlin documentation says Karma is deprecated and is not expected to receive new features or bug fixes.kotlinlang.org · read 29 Sep 2026