mkdir

abstract fun mkdir(path: Value): JsPromise<StringOrBuffer>

Method: fs.mkdir

Asynchronously creates a directory.

The optional options argument can be an integer specifying mode (permission and sticky bits), or an object with a mode property and a recursive property indicating whether parent directories should be created. Calling mkdir when path is a directory that exists results in a rejection only when recursive is false.

Return

Upon success, fulfills with undefined if recursive is false, or the first directory path created if recursive is true.

Parameters

path

The path to the directory to create.


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

Method: fs.mkdir

Asynchronously creates a directory.

The optional options argument can be an integer specifying mode (permission and sticky bits), or an object with a mode property and a recursive property indicating whether parent directories should be created. Calling mkdir when path is a directory that exists results in a rejection only when recursive is false.

Return

Upon success, fulfills with undefined if recursive is false, or the first directory path created if recursive is true.

Parameters

path

The path to the directory to create.

options

The options to use for the directory creation operation.