WritableFilesystemPromiseAPI

Node API: fs/promises (Writable)

Inheritors

Functions

Link copied to clipboard
abstract fun copyFile(src: Value, dest: Value): JsPromise<Value>
abstract fun copyFile(src: Value, dest: Value, mode: Int): JsPromise<Value>

Asynchronously copies a file.

abstract fun copyFile(src: Path, dest: Path, mode: Int? = null): JsPromise<Value>

Asynchronously copies a file using host-side types.

Link copied to clipboard
abstract fun mkdir(path: Value): JsPromise<StringOrBuffer>
abstract fun mkdir(path: Path, options: MkdirOptions? = null): JsPromise<StringOrBuffer>
abstract fun mkdir(path: Value, options: Value?): JsPromise<StringOrBuffer>

Asynchronously creates a directory.

Link copied to clipboard
abstract fun writeFile(path: Value, data: Value): JsPromise<Unit>
abstract fun writeFile(path: Path, data: StringOrBuffer, options: WriteFileOptions? = null): JsPromise<Unit>
abstract fun writeFile(path: Value, data: Value, options: Value?): JsPromise<Unit>

Asynchronously writes data to a file, replacing the file if it already exists. data can be a string, a buffer, an AsyncIterable, or an Iterable object. The promise is fulfilled with no arguments upon success.