jeff
01/21/2022, 3:40 PMreadLine()
in Kotlin/JS (nodejs target)?Vampire
01/21/2022, 3:51 PMreadline
module from node.js, targeting process.stdin
?jeff
01/21/2022, 3:57 PMimplementation(npm("readline", "17.4.0"))
but getting this:
Couldn't find any versions for "readline" that matches "17.4.0"
jeff
01/21/2022, 3:59 PMreadline
isn't a "module" in the sense of dependency? In which case I need to pull it in differently?Vampire
01/21/2022, 4:00 PMreadline
from npm which is only available in version 1.3.0 and renamed due to the node.js included module called readline
.jeff
01/21/2022, 4:02 PMimport * as readline from 'node:readline';
jeff
01/21/2022, 4:02 PMVampire
01/21/2022, 4:04 PMorg.jetbrains.kotlinx:kotlinx-nodejs
as normal dependency if you don't have it yet.
And then you can just do import readline
and use it iircjeff
01/21/2022, 4:04 PMVampire
01/21/2022, 4:06 PMVampire
01/21/2022, 4:30 PMreadln
that is fully cross-platform: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io/readln.htmljeff
01/21/2022, 5:18 PMCurrently this function is not supported in Kotlin/JS and throws UnsupportedOperationException.
😕Vampire
01/21/2022, 5:19 PM