read

common
inline fun <T> read(file: Path, readerAction: BufferedSource.() -> T): T

Creates a source to read file, executes readerAction to read it, and then closes the source. This is a compact way to read the contents of a file.

js
inline fun <T> read(file: Path, readerAction: BufferedSource.() -> T): T