How to use pure ESM packages in Kotlin/JS?

Some packages are purse ESM and fail when using @JsModule annotation to provide a type wrapper, for example

> Task :nodeDevelopmentRun FAILED
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /.../build/js/node_modules/.../index.js
require() of ES modules is not supported.
require() of /.../build/js/node_modules/.../index.js from /./build/js/packages/.../kotlin/...js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /.../build/js/node_modules/.../package.json.

    at new NodeError (node:internal/errors:363:5)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1125:13)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Function.Module._load (node:internal/modules/cjs/loader:828:14)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at Object.<anonymous> (...)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:988:32)

FAILURE: Build failed with an exception.

For example, Release v4.0.0 · sindresorhus/crypto-random-string · GitHub

How do we deal with pure ESM packages? The doc page JavaScript modules | Kotlin only talks about UMD, AMD, CommonJS, and none

https://youtrack.jetbrains.com/issue/KT-12784

Kotlin JS only supports es5.