write

common
inline fun <T> write(file: Path, writerAction: BufferedSink.() -> T): T

Creates a sink to write file, executes writerAction to write it, and then closes the sink. This is a compact way to write a file.

js
inline fun <T> write(file: Path, writerAction: BufferedSink.() -> T): T