Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
sealed external interface BigIntOptions
Link copied to clipboard
sealed external interface BigIntStats : StatsBase<<Error class: unknown class>>
Link copied to clipboard
sealed external interface BigIntStatsFs : StatsFsBase<<Error class: unknown class>>
Link copied to clipboard
typealias BigIntStatsListener = (curr: BigIntStats, prev: BigIntStats) -> Unit
Link copied to clipboard
Link copied to clipboard
sealed external interface CopyOptions : CopyOptionsBase
Link copied to clipboard
sealed external interface CopyOptionsBase
Link copied to clipboard
sealed external interface CopySyncOptions : CopyOptionsBase
Link copied to clipboard
Link copied to clipboard
sealed external interface CreateReadStreamOptions
Link copied to clipboard
Link copied to clipboard
sealed external interface CreateWriteStreamOptions
Link copied to clipboard
external interface CustomEvents

string & {} allows to allow any kind of strings for the event but still allows to have auto completion for the normal events.

Link copied to clipboard
external class Dir

A class representing a directory stream.

Link copied to clipboard
external class Dirent

A representation of a directory entry, which can be a file or a subdirectory within the directory, as returned by reading from an fs.Dir. The directory entry is a combination of the file name and file type pairs.

Link copied to clipboard
typealias EncodingOption = Any?
Link copied to clipboard
sealed external interface FileChangeInfo<T : Any>
Link copied to clipboard
sealed external interface FileHandle
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
sealed external interface FileHandleReadFileBufferAsyncOptions
Link copied to clipboard
sealed external interface FileHandleReadFileStringAsyncOptions
Link copied to clipboard
sealed external interface FileHandleStatBigIntOpts : StatOptions
Link copied to clipboard
sealed external interface FileHandleStatOpts : StatOptions
Link copied to clipboard
sealed external interface FileHandleWriteAsyncOptions
Link copied to clipboard
Link copied to clipboard
sealed external interface FileHandleWriteResultPayload<TBuffer>
Link copied to clipboard
sealed external interface FileHandleWriteStringResultPayload
Link copied to clipboard
sealed external interface FileReadOptions<T>
Link copied to clipboard
sealed external interface FileReadResult<T>
Link copied to clipboard
sealed external interface FlagAndOpenMode
Link copied to clipboard
sealed external interface FSImplementation
Link copied to clipboard
sealed external interface FstatBigIntOptions : StatOptions
Link copied to clipboard
sealed external interface FstatOptions : StatOptions
Link copied to clipboard
sealed external interface FstatSyncBigIntOptions : StatOptions
Link copied to clipboard
sealed external interface FstatSyncOptions : StatOptions
Link copied to clipboard
sealed external interface FSWatcher : EventEmitter
Link copied to clipboard
sealed external interface GlobOptions : GlobOptionsBase
Link copied to clipboard
sealed external interface GlobOptionsBase
Link copied to clipboard
sealed external interface GlobOptionsWithFileTypes : GlobOptionsBase
Link copied to clipboard
sealed external interface GlobOptionsWithoutFileTypes : GlobOptionsBase
Link copied to clipboard
sealed external interface LstatBigIntOptions : StatOptions
Link copied to clipboard
sealed external interface LstatBigIntOpts : StatOptions
Link copied to clipboard
sealed external interface LstatOptions : StatOptions
Link copied to clipboard
sealed external interface LstatOpts : StatOptions
Link copied to clipboard
sealed external interface MakeDirectoryOptions
Link copied to clipboard
sealed external interface MkdirAsyncOptions : MakeDirectoryOptions
Link copied to clipboard
sealed external interface MkdirOptions : MakeDirectoryOptions
Link copied to clipboard
Link copied to clipboard
sealed external interface MkdirRecursiveOptions : MakeDirectoryOptions
Link copied to clipboard
sealed external interface MkdirSyncOptions : MakeDirectoryOptions
Link copied to clipboard
Link copied to clipboard
sealed external interface MkdtempOptions
Link copied to clipboard
typealias Mode = Any
Link copied to clipboard
typealias NoParamCallback = (err: ErrnoException?) -> Unit
Link copied to clipboard
external interface ObjectEncodingOptions
Link copied to clipboard
sealed external interface OpenAsBlobOptions
Link copied to clipboard
sealed external interface OpenDirOptions
Link copied to clipboard
typealias OpenMode = Any
Link copied to clipboard
typealias PathLike = Any

Valid types for path values in "fs".

Link copied to clipboard
Link copied to clipboard
sealed external interface ReadableWebStreamOptions
Link copied to clipboard
sealed external interface ReadAsyncOptions<TBuffer> : ReadSyncOptions
Link copied to clipboard
sealed external interface ReaddirAsyncOptions : ObjectEncodingOptions
Link copied to clipboard
sealed external interface ReaddirBufferAsyncOptions
Link copied to clipboard
sealed external interface ReaddirBufferOptions
Link copied to clipboard
sealed external interface ReaddirOptions : ObjectEncodingOptions
Link copied to clipboard
sealed external interface ReaddirStringOptions
Link copied to clipboard
sealed external interface ReaddirSyncBufferOptions
Link copied to clipboard
sealed external interface ReaddirSyncOptions : ObjectEncodingOptions
Link copied to clipboard
sealed external interface ReaddirSyncStringOptions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
sealed external interface ReadFileAsyncOptions : ObjectEncodingOptions
Link copied to clipboard
sealed external interface ReadFileBufferAsyncOptions
Link copied to clipboard
sealed external interface ReadFileBufferOptions
Link copied to clipboard
sealed external interface ReadFileOptions : ObjectEncodingOptions
Link copied to clipboard
sealed external interface ReadFileStringAsyncOptions
Link copied to clipboard
sealed external interface ReadFileStringOptions
Link copied to clipboard
sealed external interface ReadFileSyncBufferOptions
Link copied to clipboard
sealed external interface ReadFileSyncOptions : ObjectEncodingOptions
Link copied to clipboard
sealed external interface ReadFileSyncStringOptions
Link copied to clipboard
typealias ReadPosition = Any
Link copied to clipboard
external class ReadStream : Readable

Instances of fs.ReadStream are created and returned using the {@link createReadStream} function.

Link copied to clipboard
sealed external interface ReadStreamEvents : CustomEvents

The Keys are events of the ReadStream and the values are the functions that are called when the event is emitted.

Link copied to clipboard
sealed external interface ReadStreamOptions : StreamOptions
Link copied to clipboard
sealed external interface ReadSyncOptions
Link copied to clipboard
sealed external interface ReadVResult
Link copied to clipboard
sealed external interface RmDirOptions
Link copied to clipboard
sealed external interface RmOptions
Link copied to clipboard
sealed external interface StatBigIntOptions : StatOptions
Link copied to clipboard
sealed external interface StatBigIntOpts : StatOptions
Link copied to clipboard
sealed external interface StatfsBigIntOptions : StatFsOptions
Link copied to clipboard
sealed external interface StatfsBigIntOpts : StatFsOptions
Link copied to clipboard
sealed external interface StatFsOptions
Link copied to clipboard
sealed external interface StatfsOptions : StatFsOptions
Link copied to clipboard
sealed external interface StatfsOpts : StatFsOptions
Link copied to clipboard
sealed external interface StatfsSyncBigIntOptions : StatFsOptions
Link copied to clipboard
sealed external interface StatfsSyncOptions : StatFsOptions
Link copied to clipboard
sealed external interface StatOptions
Link copied to clipboard
external class Stats : StatsBase<Double>

A fs.Stats object provides information about a file.

Link copied to clipboard
sealed external interface StatsBase<T>
Link copied to clipboard
external class StatsFs : StatsFsBase<Double>

Provides information about a mounted file system.

Link copied to clipboard
sealed external interface StatsFsBase<T>
Link copied to clipboard
sealed external interface StatSimpleOptions : StatOptions
Link copied to clipboard
sealed external interface StatSimpleOpts : StatOptions
Link copied to clipboard
typealias StatsListener = (curr: Stats, prev: Stats) -> Unit
Link copied to clipboard
sealed external interface StatSyncFn
Link copied to clipboard
sealed external interface StatSyncFnBigIntOptions : StatSyncOptions
Link copied to clipboard
sealed external interface StatSyncFnOptions : StatSyncOptions
Link copied to clipboard
sealed external interface StatSyncFnSimpleOptions : StatSyncOptions
Link copied to clipboard
sealed external interface StatSyncOptions : StatOptions
Link copied to clipboard
sealed external interface StatWatcher : EventEmitter

Class: fs.StatWatcher

Link copied to clipboard
sealed external interface StreamOptions
Link copied to clipboard
sealed external interface SymlinkType
Link copied to clipboard
typealias TimeLike = Any
Link copied to clipboard
sealed external interface WatchBufferAsyncOptions : WatchOptions
Link copied to clipboard
sealed external interface WatchBufferOptions : WatchOptions
Link copied to clipboard
sealed external interface WatchEventType
Link copied to clipboard
sealed external interface WatchFileBigIntOptions : WatchFileOptions
Link copied to clipboard
sealed external interface WatchFileOptions

Watch for changes on filename. The callback listener will be called each time the file is accessed.

Link copied to clipboard
sealed external interface WatchFileSimpleOptions : WatchFileOptions
Link copied to clipboard
typealias WatchListener<T> = (event: WatchEventType, filename: T?) -> Unit
Link copied to clipboard
sealed external interface WatchOptions
Link copied to clipboard
sealed external interface WriteFileAsyncOptions : ObjectEncodingOptions
Link copied to clipboard
typealias WriteFileOptions = Any?
Link copied to clipboard
external class WriteStream : Writable

Instances of fs.WriteStream are created and returned using the {@link createWriteStream} function.

Link copied to clipboard
sealed external interface WriteStreamEvents : CustomEvents

The Keys are events of the WriteStream and the values are the functions that are called when the event is emitted.

Link copied to clipboard
sealed external interface WriteStreamOptions : StreamOptions
Link copied to clipboard
sealed external interface WriteVResult

Properties

Link copied to clipboard
external val constants: Any
Link copied to clipboard
external val lstatSync: StatSyncFn
Link copied to clipboard
external val statSync: StatSyncFn

Functions

Link copied to clipboard
external fun access(path: PathLike, callback: NoParamCallback)

Asynchronously tests a user's permissions for the file specified by path.

suspend external fun access(path: PathLike, mode: Number = definedExternally): <Error class: unknown class>

external fun access(path: PathLike, mode: Double?, callback: NoParamCallback)

Tests a user's permissions for the file or directory specified by path. The mode argument is an optional integer that specifies the accessibility checks to be performed. mode should be either the value fs.constants.F_OK or a mask consisting of the bitwise OR of any of fs.constants.R_OK, fs.constants.W_OK, and fs.constants.X_OK (e.g.fs.constants.W_OK | fs.constants.R_OK). Check File access constants for possible values of mode.

Link copied to clipboard
external fun accessAsync(path: PathLike, mode: Number = definedExternally): <Error class: unknown class><<Error class: unknown class>>

Tests a user's permissions for the file or directory specified by path. The mode argument is an optional integer that specifies the accessibility checks to be performed. mode should be either the value fs.constants.F_OK or a mask consisting of the bitwise OR of any of fs.constants.R_OK, fs.constants.W_OK, and fs.constants.X_OK (e.g.fs.constants.W_OK | fs.constants.R_OK). Check File access constants for possible values of mode.

Link copied to clipboard
external fun accessSync(path: PathLike, mode: Number = definedExternally)

Synchronously tests a user's permissions for the file or directory specified by path. The mode argument is an optional integer that specifies the accessibility checks to be performed. mode should be either the value fs.constants.F_OK or a mask consisting of the bitwise OR of any of fs.constants.R_OK, fs.constants.W_OK, and fs.constants.X_OK (e.g.fs.constants.W_OK | fs.constants.R_OK). Check File access constants for possible values of mode.

Link copied to clipboard
suspend external fun appendFile(    path: PathLike,     data: <Error class: unknown class><out <Error class: unknown class>>): <Error class: unknown class>
suspend external fun appendFile(    path: FileHandle,     data: <Error class: unknown class><out <Error class: unknown class>>): <Error class: unknown class>
suspend external fun appendFile(path: FileHandle, data: String): <Error class: unknown class>
suspend external fun appendFile(    path: PathLike,     data: <Error class: unknown class><out <Error class: unknown class>>,     options: BufferEncoding? = definedExternally): <Error class: unknown class>
suspend external fun appendFile(    path: PathLike,     data: <Error class: unknown class><out <Error class: unknown class>>,     options: AppendFileAsyncOptions? = definedExternally): <Error class: unknown class>
suspend external fun appendFile(path: PathLike, data: String, options: BufferEncoding? = definedExternally): <Error class: unknown class>
suspend external fun appendFile(path: PathLike, data: String, options: AppendFileAsyncOptions? = definedExternally): <Error class: unknown class>
suspend external fun appendFile(    path: FileHandle,     data: <Error class: unknown class><out <Error class: unknown class>>,     options: BufferEncoding? = definedExternally): <Error class: unknown class>
suspend external fun appendFile(    path: FileHandle,     data: <Error class: unknown class><out <Error class: unknown class>>,     options: AppendFileAsyncOptions? = definedExternally): <Error class: unknown class>
suspend external fun appendFile(path: FileHandle, data: String, options: BufferEncoding? = definedExternally): <Error class: unknown class>
suspend external fun appendFile(path: FileHandle, data: String, options: AppendFileAsyncOptions? = definedExternally): <Error class: unknown class>
external fun appendFile(    path: PathOrFileDescriptor,     data: <Error class: unknown class><out <Error class: unknown class>>,     options: WriteFileOptions,     callback: NoParamCallback)
external fun appendFile(path: PathOrFileDescriptor, data: String, options: WriteFileOptions, callback: NoParamCallback)

Asynchronously append data to a file, creating the file if it does not yet exist. data can be a string or a Buffer.

suspend external fun appendFile(path: PathLike, data: String): <Error class: unknown class>

external fun appendFile(    file: PathOrFileDescriptor,     data: <Error class: unknown class><out <Error class: unknown class>>,     callback: NoParamCallback)
external fun appendFile(file: PathOrFileDescriptor, data: String, callback: NoParamCallback)

Asynchronously append data to a file, creating the file if it does not exist.

Link copied to clipboard
external fun appendFileAsync(    path: PathLike,     data: <Error class: unknown class><out <Error class: unknown class>>): <Error class: unknown class><<Error class: unknown class>>
external fun appendFileAsync(path: PathLike, data: String): <Error class: unknown class><<Error class: unknown class>>
external fun appendFileAsync(    path: FileHandle,     data: <Error class: unknown class><out <Error class: unknown class>>): <Error class: unknown class><<Error class: unknown class>>
external fun appendFileAsync(path: FileHandle, data: String): <Error class: unknown class><<Error class: unknown class>>
external fun appendFileAsync(    path: PathLike,     data: <Error class: unknown class><out <Error class: unknown class>>,     options: BufferEncoding? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun appendFileAsync(    path: PathLike,     data: <Error class: unknown class><out <Error class: unknown class>>,     options: AppendFileAsyncOptions? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun appendFileAsync(    path: PathLike,     data: String,     options: BufferEncoding? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun appendFileAsync(    path: PathLike,     data: String,     options: AppendFileAsyncOptions? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun appendFileAsync(    path: FileHandle,     data: <Error class: unknown class><out <Error class: unknown class>>,     options: BufferEncoding? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun appendFileAsync(    path: FileHandle,     data: <Error class: unknown class><out <Error class: unknown class>>,     options: AppendFileAsyncOptions? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun appendFileAsync(    path: FileHandle,     data: String,     options: BufferEncoding? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun appendFileAsync(    path: FileHandle,     data: String,     options: AppendFileAsyncOptions? = definedExternally): <Error class: unknown class><<Error class: unknown class>>

Asynchronously append data to a file, creating the file if it does not yet exist. data can be a string or a Buffer.

Link copied to clipboard
external fun appendFileSync(    path: PathOrFileDescriptor,     data: <Error class: unknown class><out <Error class: unknown class>>,     options: WriteFileOptions = definedExternally)
external fun appendFileSync(path: PathOrFileDescriptor, data: String, options: WriteFileOptions = definedExternally)

Synchronously append data to a file, creating the file if it does not yet exist. data can be a string or a Buffer.

Link copied to clipboard
suspend external fun chmod(path: PathLike, mode: Mode): <Error class: unknown class>

external fun chmod(path: PathLike, mode: Mode, callback: NoParamCallback)

Asynchronously changes the permissions of a file. No arguments other than a possible exception are given to the completion callback.

Link copied to clipboard
external fun chmodAsync(path: PathLike, mode: Mode): <Error class: unknown class><<Error class: unknown class>>

Changes the permissions of a file.

Link copied to clipboard
external fun chmodSync(path: PathLike, mode: Mode)

For detailed information, see the documentation of the asynchronous version of this API: {@link chmod}.

Link copied to clipboard
suspend external fun chown(path: PathLike, uid: Number, gid: Number): <Error class: unknown class>

external fun chown(path: PathLike, uid: Number, gid: Number, callback: NoParamCallback)

Asynchronously changes owner and group of a file. No arguments other than a possible exception are given to the completion callback.

Link copied to clipboard
external fun chownAsync(path: PathLike, uid: Number, gid: Number): <Error class: unknown class><<Error class: unknown class>>

Changes the ownership of a file.

Link copied to clipboard
external fun chownSync(path: PathLike, uid: Number, gid: Number)

Synchronously changes owner and group of a file. Returns undefined. This is the synchronous version of {@link chown}.

Link copied to clipboard
external fun close(fd: Number, callback: NoParamCallback = definedExternally)

Closes the file descriptor. No arguments other than a possible exception are given to the completion callback.

Link copied to clipboard
external fun closeSync(fd: Number)

Closes the file descriptor. Returns undefined.

Link copied to clipboard
external fun copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback)

Asynchronously copies src to dest. By default, dest is overwritten if it already exists. No arguments other than a possible exception are given to the callback function. Node.js makes no guarantees about the atomicity of the copy operation. If an error occurs after the destination file has been opened for writing, Node.js will attempt to remove the destination.

suspend external fun copyFile(src: PathLike, dest: PathLike, mode: Number = definedExternally): <Error class: unknown class>
external fun copyFile(src: PathLike, dest: PathLike, mode: Number, callback: NoParamCallback)
Link copied to clipboard
external fun copyFileAsync(    src: PathLike,     dest: PathLike,     mode: Number = definedExternally): <Error class: unknown class><<Error class: unknown class>>

Asynchronously copies src to dest. By default, dest is overwritten if it already exists.

Link copied to clipboard
external fun copyFileSync(src: PathLike, dest: PathLike, mode: Number = definedExternally)

Synchronously copies src to dest. By default, dest is overwritten if it already exists. Returns undefined. Node.js makes no guarantees about the atomicity of the copy operation. If an error occurs after the destination file has been opened for writing, Node.js will attempt to remove the destination.

Link copied to clipboard
external fun cp(source: <Error class: unknown class>, destination: <Error class: unknown class>, callback: (err: ErrnoException?) -> Unit)
suspend external fun cp(    source: <Error class: unknown class>,     destination: <Error class: unknown class>,     opts: CopyOptions = definedExternally): <Error class: unknown class>
external fun cp(source: <Error class: unknown class>, destination: String, callback: (err: ErrnoException?) -> Unit)
suspend external fun cp(    source: <Error class: unknown class>,     destination: String,     opts: CopyOptions = definedExternally): <Error class: unknown class>
external fun cp(source: String, destination: <Error class: unknown class>, callback: (err: ErrnoException?) -> Unit)
suspend external fun cp(    source: String,     destination: <Error class: unknown class>,     opts: CopyOptions = definedExternally): <Error class: unknown class>
external fun cp(source: String, destination: String, callback: (err: ErrnoException?) -> Unit)

Asynchronously copies the entire directory structure from src to dest, including subdirectories and files.

suspend external fun cp(source: String, destination: String, opts: CopyOptions = definedExternally): <Error class: unknown class>
external fun cp(    source: <Error class: unknown class>,     destination: <Error class: unknown class>,     opts: CopyOptions,     callback: (err: ErrnoException?) -> Unit)
external fun cp(source: <Error class: unknown class>, destination: String, opts: CopyOptions, callback: (err: ErrnoException?) -> Unit)
external fun cp(source: String, destination: <Error class: unknown class>, opts: CopyOptions, callback: (err: ErrnoException?) -> Unit)
external fun cp(source: String, destination: String, opts: CopyOptions, callback: (err: ErrnoException?) -> Unit)
Link copied to clipboard
external fun cpAsync(    source: <Error class: unknown class>,     destination: <Error class: unknown class>,     opts: CopyOptions = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun cpAsync(    source: <Error class: unknown class>,     destination: String,     opts: CopyOptions = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun cpAsync(    source: String,     destination: <Error class: unknown class>,     opts: CopyOptions = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun cpAsync(    source: String,     destination: String,     opts: CopyOptions = definedExternally): <Error class: unknown class><<Error class: unknown class>>

Asynchronously copies the entire directory structure from src to dest, including subdirectories and files.

Link copied to clipboard
external fun cpSync(source: <Error class: unknown class>, destination: <Error class: unknown class>, opts: CopySyncOptions = definedExternally)
external fun cpSync(source: <Error class: unknown class>, destination: String, opts: CopySyncOptions = definedExternally)
external fun cpSync(source: String, destination: <Error class: unknown class>, opts: CopySyncOptions = definedExternally)
external fun cpSync(source: String, destination: String, opts: CopySyncOptions = definedExternally)

Synchronously copies the entire directory structure from src to dest, including subdirectories and files.

Link copied to clipboard
external fun createReadStream(path: PathLike): ReadStream
external fun createReadStream(path: PathLike, options: BufferEncoding = definedExternally): ReadStream
external fun createReadStream(path: PathLike, options: ReadStreamOptions = definedExternally): ReadStream

options can include start and end values to read a range of bytes from the file instead of the entire file. Both start and end are inclusive and start counting at 0, allowed values are in the \[0, Number.MAX_SAFE_INTEGER\] range. If fd is specified and start is omitted or undefined, fs.createReadStream() reads sequentially from the current file position. The encoding can be any one of those accepted by Buffer.

Link copied to clipboard
external fun createWriteStream(path: PathLike, options: BufferEncoding = definedExternally): WriteStream
external fun createWriteStream(path: PathLike, options: WriteStreamOptions = definedExternally): WriteStream

options may also include a start option to allow writing data at some position past the beginning of the file, allowed values are in the \[0, Number.MAX_SAFE_INTEGER\] range. Modifying a file rather than replacing it may require the flags option to be set to r+ rather than the default w. The encoding can be any one of those accepted by Buffer.

Link copied to clipboard
suspend fun exists(path: PathLike): Boolean

Returns true if the path exists, false otherwise.

external fun exists(path: PathLike, callback: (exists: Boolean) -> Unit)

Test whether or not the given path exists by checking with the file system. Then call the callback argument with either true or false:

Link copied to clipboard
fun existsAsync(path: PathLike): <Error class: unknown class><Boolean>

Returns true if the path exists, false otherwise.

Link copied to clipboard
external fun existsSync(path: PathLike): Boolean

Returns true if the path exists, false otherwise.

Link copied to clipboard
external fun fchmod(fd: Number, mode: Mode, callback: NoParamCallback)

Sets the permissions on the file. No arguments other than a possible exception are given to the completion callback.

Link copied to clipboard
external fun fchmodSync(fd: Number, mode: Mode)

Sets the permissions on the file. Returns undefined.

Link copied to clipboard
external fun fchown(fd: Number, uid: Number, gid: Number, callback: NoParamCallback)

Sets the owner of the file. No arguments other than a possible exception are given to the completion callback.

Link copied to clipboard
external fun fchownSync(fd: Number, uid: Number, gid: Number)

Sets the owner of the file. Returns undefined.

Link copied to clipboard
external fun fdatasync(fd: Number, callback: NoParamCallback)

Forces all currently queued I/O operations associated with the file to the operating system's synchronized I/O completion state. Refer to the POSIX fdatasync(2) documentation for details. No arguments other than a possible exception are given to the completion callback.

Link copied to clipboard
external fun fdatasyncSync(fd: Number)

Forces all currently queued I/O operations associated with the file to the operating system's synchronized I/O completion state. Refer to the POSIX fdatasync(2) documentation for details. Returns undefined.

Link copied to clipboard
external fun fstat(fd: Number, callback: (err: ErrnoException?, stats: Stats) -> Unit)

Invokes the callback with the fs.Stats for the file descriptor.

external fun fstat(fd: Number, options: FstatBigIntOptions, callback: (err: ErrnoException?, stats: BigIntStats) -> Unit)
external fun fstat(fd: Number, options: FstatOptions?, callback: (err: ErrnoException?, stats: Stats) -> Unit)
external fun fstat(fd: Number, options: StatOptions?, callback: (err: ErrnoException?, stats: Any) -> Unit)
Link copied to clipboard
external fun fstatSync(fd: Number): Stats
external fun fstatSync(fd: Number, options: FstatSyncBigIntOptions): BigIntStats
external fun fstatSync(fd: Number, options: StatOptions = definedExternally): Any

external fun fstatSync(fd: Number, options: FstatSyncOptions = definedExternally): Stats

Retrieves the fs.Stats for the file descriptor.

Link copied to clipboard
external fun fsync(fd: Number, callback: NoParamCallback)

Request that all data for the open file descriptor is flushed to the storage device. The specific implementation is operating system and device specific. Refer to the POSIX fsync(2) documentation for more detail. No arguments other than a possible exception are given to the completion callback.

Link copied to clipboard
external fun fsyncSync(fd: Number)

Request that all data for the open file descriptor is flushed to the storage device. The specific implementation is operating system and device specific. Refer to the POSIX fsync(2) documentation for more detail. Returns undefined.

Link copied to clipboard
external fun ftruncate(fd: Number, callback: NoParamCallback)

Asynchronous ftruncate(2) - Truncate a file to a specified length.

external fun ftruncate(fd: Number, len: Double?, callback: NoParamCallback)

Truncates the file descriptor. No arguments other than a possible exception are given to the completion callback.

Link copied to clipboard
external fun ftruncateSync(fd: Number, len: Double? = definedExternally)

Truncates the file descriptor. Returns undefined.

Link copied to clipboard
external fun futimes(fd: Number, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback)

Change the file system timestamps of the object referenced by the supplied file descriptor. See {@link utimes}.

Link copied to clipboard
external fun futimesSync(fd: Number, atime: TimeLike, mtime: TimeLike)

Synchronous version of {@link futimes}. Returns undefined.

Link copied to clipboard
external fun glob(pattern: <Error class: unknown class><String>): <Error class: unknown class><String>
external fun glob(pattern: String): <Error class: unknown class><String>
external fun glob(pattern: <Error class: unknown class><String>, callback: (err: ErrnoException?, <Error class: unknown class><String>) -> Unit)
external fun glob(pattern: String, callback: (err: ErrnoException?, <Error class: unknown class><String>) -> Unit)

Retrieves the files matching the specified pattern.

external fun glob(pattern: <Error class: unknown class><String>, opt: GlobOptions): <Error class: unknown class><Any>
external fun glob(pattern: <Error class: unknown class><String>, opt: GlobOptionsWithFileTypes): <Error class: unknown class><Dirent>
external fun glob(pattern: <Error class: unknown class><String>, opt: GlobOptionsWithoutFileTypes): <Error class: unknown class><String>
external fun glob(pattern: String, opt: GlobOptions): <Error class: unknown class><Any>
external fun glob(pattern: String, opt: GlobOptionsWithFileTypes): <Error class: unknown class><Dirent>
external fun glob(pattern: String, opt: GlobOptionsWithoutFileTypes): <Error class: unknown class><String>
external fun glob(pattern: <Error class: unknown class><String>, options: GlobOptions, callback: (err: ErrnoException?, matches: Any) -> Unit)
external fun glob(    pattern: <Error class: unknown class><String>,     options: GlobOptionsWithFileTypes,     callback: (err: ErrnoException?, <Error class: unknown class><Dirent>) -> Unit)
external fun glob(    pattern: <Error class: unknown class><String>,     options: GlobOptionsWithoutFileTypes,     callback: (err: ErrnoException?, <Error class: unknown class><String>) -> Unit)
external fun glob(pattern: String, options: GlobOptions, callback: (err: ErrnoException?, matches: Any) -> Unit)
external fun glob(pattern: String, options: GlobOptionsWithFileTypes, callback: (err: ErrnoException?, <Error class: unknown class><Dirent>) -> Unit)
external fun glob(    pattern: String,     options: GlobOptionsWithoutFileTypes,     callback: (err: ErrnoException?, <Error class: unknown class><String>) -> Unit)
Link copied to clipboard
external fun globSync(pattern: <Error class: unknown class><String>): <Error class: unknown class><String>
external fun globSync(pattern: String): <Error class: unknown class><String>

Retrieves the files matching the specified pattern.

external fun globSync(pattern: <Error class: unknown class><String>, options: GlobOptions): Any
external fun globSync(pattern: <Error class: unknown class><String>, options: GlobOptionsWithFileTypes): <Error class: unknown class><Dirent>
external fun globSync(pattern: <Error class: unknown class><String>, options: GlobOptionsWithoutFileTypes): <Error class: unknown class><String>
external fun globSync(pattern: String, options: GlobOptions): Any
external fun globSync(pattern: String, options: GlobOptionsWithFileTypes): <Error class: unknown class><Dirent>
external fun globSync(pattern: String, options: GlobOptionsWithoutFileTypes): <Error class: unknown class><String>
Link copied to clipboard
suspend external fun lchmod(path: PathLike, mode: Mode): <Error class: unknown class>

external fun lchmod(path: PathLike, mode: Mode, callback: NoParamCallback)

Changes the permissions on a symbolic link. No arguments other than a possible exception are given to the completion callback.

Link copied to clipboard
external fun lchmodAsync(path: PathLike, mode: Mode): <Error class: unknown class><<Error class: unknown class>>

Changes the permissions on a symbolic link.

Link copied to clipboard
external fun lchmodSync(path: PathLike, mode: Mode)

Changes the permissions on a symbolic link. Returns undefined.

Link copied to clipboard
suspend external fun lchown(path: PathLike, uid: Number, gid: Number): <Error class: unknown class>

external fun lchown(path: PathLike, uid: Number, gid: Number, callback: NoParamCallback)

Set the owner of the symbolic link. No arguments other than a possible exception are given to the completion callback.

Link copied to clipboard
external fun lchownAsync(path: PathLike, uid: Number, gid: Number): <Error class: unknown class><<Error class: unknown class>>

Changes the ownership on a symbolic link.

Link copied to clipboard
external fun lchownSync(path: PathLike, uid: Number, gid: Number)

Set the owner for the path. Returns undefined.

Link copied to clipboard
suspend external fun link(existingPath: PathLike, newPath: PathLike): <Error class: unknown class>

external fun link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback)

Creates a new link from the existingPath to the newPath. See the POSIX link(2) documentation for more detail. No arguments other than a possible exception are given to the completion callback.

Link copied to clipboard
external fun linkAsync(existingPath: PathLike, newPath: PathLike): <Error class: unknown class><<Error class: unknown class>>

Creates a new link from the existingPath to the newPath. See the POSIX link(2) documentation for more detail.

Link copied to clipboard
external fun linkSync(existingPath: PathLike, newPath: PathLike)

Creates a new link from the existingPath to the newPath. See the POSIX link(2) documentation for more detail. Returns undefined.

Link copied to clipboard
suspend external fun lstat(path: PathLike): Stats
suspend external fun lstat(path: PathLike, opts: LstatBigIntOpts): BigIntStats
suspend external fun lstat(path: PathLike, opts: LstatOpts = definedExternally): Stats
suspend external fun lstat(path: PathLike, opts: StatOptions = definedExternally): Any
external fun lstat(path: PathLike, options: LstatBigIntOptions, callback: (err: ErrnoException?, stats: BigIntStats) -> Unit)
external fun lstat(path: PathLike, options: LstatOptions?, callback: (err: ErrnoException?, stats: Stats) -> Unit)
external fun lstat(path: PathLike, options: StatOptions?, callback: (err: ErrnoException?, stats: Any) -> Unit)

external fun lstat(path: PathLike, callback: (err: ErrnoException?, stats: Stats) -> Unit)

Retrieves the fs.Stats for the symbolic link referred to by the path. The callback gets two arguments (err, stats) where stats is a fs.Stats object. lstat() is identical to stat(), except that if path is a symbolic link, then the link itself is stat-ed, not the file that it refers to.

Link copied to clipboard
external fun lstatAsync(path: PathLike): <Error class: unknown class><Stats>
external fun lstatAsync(path: PathLike, opts: LstatBigIntOpts): <Error class: unknown class><BigIntStats>
external fun lstatAsync(path: PathLike, opts: StatOptions = definedExternally): <Error class: unknown class><Any>

external fun lstatAsync(path: PathLike, opts: LstatOpts = definedExternally): <Error class: unknown class><Stats>

Equivalent to fsPromises.stat() unless path refers to a symbolic link, in which case the link itself is stat-ed, not the file that it refers to. Refer to the POSIX lstat(2) document for more detail.

Link copied to clipboard
suspend external fun lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike): <Error class: unknown class>

external fun lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback)

Changes the access and modification times of a file in the same way as {@link utimes}, with the difference that if the path refers to a symbolic link, then the link is not dereferenced: instead, the timestamps of the symbolic link itself are changed.

Link copied to clipboard
external fun lutimesAsync(path: PathLike, atime: TimeLike, mtime: TimeLike): <Error class: unknown class><<Error class: unknown class>>

Changes the access and modification times of a file in the same way as fsPromises.utimes(), with the difference that if the path refers to a symbolic link, then the link is not dereferenced: instead, the timestamps of the symbolic link itself are changed.

Link copied to clipboard
external fun lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike)

Change the file system timestamps of the symbolic link referenced by path. Returns undefined, or throws an exception when parameters are incorrect or the operation fails. This is the synchronous version of {@link lutimes}.

Link copied to clipboard
suspend external fun mkdir(path: PathLike): <Error class: unknown class>
suspend external fun mkdir(path: PathLike, options: MkdirRecursiveAsyncOptions): String?

suspend external fun mkdir(path: PathLike, options: Mode? = definedExternally): <Error class: unknown class>
suspend external fun mkdir(path: PathLike, options: MakeDirectoryOptions? = definedExternally): String?
suspend external fun mkdir(path: PathLike, options: MkdirAsyncOptions? = definedExternally): <Error class: unknown class>
external fun mkdir(path: PathLike, options: Mode?, callback: NoParamCallback)
external fun mkdir(path: PathLike, options: Mode?, callback: (err: ErrnoException?, path: String?) -> Unit)
external fun mkdir(path: PathLike, options: MakeDirectoryOptions?, callback: (err: ErrnoException?, path: String?) -> Unit)
external fun mkdir(path: PathLike, options: MkdirOptions?, callback: NoParamCallback)

Asynchronous mkdir(2) - create a directory.

external fun mkdir(path: PathLike, callback: NoParamCallback)

Asynchronous mkdir(2) - create a directory with a mode of 0o777.

external fun mkdir(path: PathLike, options: MkdirRecursiveOptions, callback: (err: ErrnoException?, path: String?) -> Unit)

Asynchronously creates a directory.

Link copied to clipboard
external fun mkdirAsync(path: PathLike): <Error class: unknown class><<Error class: unknown class>>
external fun mkdirAsync(path: PathLike, options: Mode? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun mkdirAsync(path: PathLike, options: MakeDirectoryOptions? = definedExternally): <Error class: unknown class><String?>
external fun mkdirAsync(    path: PathLike,     options: MkdirAsyncOptions? = definedExternally): <Error class: unknown class><<Error class: unknown class>>

Asynchronous mkdir(2) - create a directory.

external fun mkdirAsync(path: PathLike, options: MkdirRecursiveAsyncOptions): <Error class: unknown class><String?>

Asynchronously creates a directory.

Link copied to clipboard
external fun mkdirSync(path: PathLike)
external fun mkdirSync(path: PathLike, options: Mode? = definedExternally)
external fun mkdirSync(path: PathLike, options: MakeDirectoryOptions? = definedExternally): String?
external fun mkdirSync(path: PathLike, options: MkdirSyncOptions? = definedExternally)

Synchronous mkdir(2) - create a directory.

external fun mkdirSync(path: PathLike, options: MkdirSyncRecursiveOptions): String?

Synchronously creates a directory. Returns undefined, or if recursive is true, the first directory path created. This is the synchronous version of {@link mkdir}.

Link copied to clipboard
suspend external fun mkdtemp(prefix: String): String
suspend external fun mkdtemp(prefix: String, options: BufferEncodingOption): Buffer<*>

external fun mkdtemp(prefix: String, callback: (err: ErrnoException?, folder: String) -> Unit)
external fun mkdtemp(prefix: String, options: EncodingOption, callback: (err: ErrnoException?, folder: Any) -> Unit)
external fun mkdtemp(prefix: String, options: String, callback: (err: ErrnoException?, folder: Buffer<*>) -> Unit)
external fun mkdtemp(prefix: String, options: MkdtempOptions, callback: (err: ErrnoException?, folder: Buffer<*>) -> Unit)

Asynchronously creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory.

suspend external fun mkdtemp(prefix: String, options: BufferEncoding? = definedExternally): String
suspend external fun mkdtemp(prefix: String, options: ObjectEncodingOptions? = definedExternally): String

Creates a unique temporary directory. A unique directory name is generated by appending six random characters to the end of the provided prefix. Due to platform inconsistencies, avoid trailing X characters in prefix. Some platforms, notably the BSDs, can return more than six random characters, and replace trailing X characters in prefix with random characters.

external fun mkdtemp(prefix: String, options: EncodingOption, callback: (err: ErrnoException?, folder: String) -> Unit)

Creates a unique temporary directory.

Link copied to clipboard
external fun mkdtempAsync(prefix: String): <Error class: unknown class><String>
external fun mkdtempAsync(prefix: String, options: BufferEncoding? = definedExternally): <Error class: unknown class><String>
external fun mkdtempAsync(prefix: String, options: ObjectEncodingOptions? = definedExternally): <Error class: unknown class><String>

Creates a unique temporary directory. A unique directory name is generated by appending six random characters to the end of the provided prefix. Due to platform inconsistencies, avoid trailing X characters in prefix. Some platforms, notably the BSDs, can return more than six random characters, and replace trailing X characters in prefix with random characters.

external fun mkdtempAsync(prefix: String, options: BufferEncodingOption): <Error class: unknown class><Buffer<*>>

Asynchronously creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory.

Link copied to clipboard
external fun mkdtempSync(prefix: String): String
external fun mkdtempSync(prefix: String, options: BufferEncodingOption): Buffer<*>

Synchronously creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory.

external fun mkdtempSync(prefix: String, options: EncodingOption = definedExternally): String

Returns the created directory path.

Link copied to clipboard
suspend external fun open(path: PathLike): FileHandle

external fun open(path: PathLike, callback: (err: ErrnoException?, fd: Double) -> Unit)
external fun open(path: PathLike, flags: OpenMode?, callback: (err: ErrnoException?, fd: Double) -> Unit)

Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be 0o666.

suspend external fun open(path: PathLike, flags: Double = definedExternally, mode: Mode = definedExternally): FileHandle
suspend external fun open(path: PathLike, flags: String = definedExternally, mode: Mode = definedExternally): FileHandle

Opens a FileHandle.

external fun open(path: PathLike, flags: OpenMode?, mode: Mode?, callback: (err: ErrnoException?, fd: Double) -> Unit)

Asynchronous file open. See the POSIX open(2) documentation for more details.

Link copied to clipboard
suspend external fun openAsBlob(path: PathLike, options: OpenAsBlobOptions = definedExternally): <Error class: unknown class>
Link copied to clipboard
external fun openAsBlobAsync(    path: PathLike,     options: OpenAsBlobOptions = definedExternally): <Error class: unknown class><<Error class: unknown class>>

Returns a Blob whose data is backed by the given file.

Link copied to clipboard
external fun openAsync(path: PathLike): <Error class: unknown class><FileHandle>
external fun openAsync(    path: PathLike,     flags: Double = definedExternally,     mode: Mode = definedExternally): <Error class: unknown class><FileHandle>
external fun openAsync(    path: PathLike,     flags: String = definedExternally,     mode: Mode = definedExternally): <Error class: unknown class><FileHandle>

Opens a FileHandle.

Link copied to clipboard
external fun opendir(path: PathLike, cb: (err: ErrnoException?, dir: Dir) -> Unit)

Asynchronously open a directory. See the POSIX opendir(3) documentation for more details.

suspend external fun opendir(path: PathLike, options: OpenDirOptions = definedExternally): Dir
external fun opendir(path: PathLike, options: OpenDirOptions, cb: (err: ErrnoException?, dir: Dir) -> Unit)
Link copied to clipboard
external fun opendirAsync(path: PathLike, options: OpenDirOptions = definedExternally): <Error class: unknown class><Dir>

Asynchronously open a directory for iterative scanning. See the POSIX opendir(3) documentation for more detail.

Link copied to clipboard
external fun opendirSync(path: PathLike, options: OpenDirOptions = definedExternally): Dir

Synchronously open a directory. See opendir(3).

Link copied to clipboard
external fun openSync(path: PathLike, flags: OpenMode, mode: Mode? = definedExternally): Double

Returns an integer representing the file descriptor.

Link copied to clipboard
external fun read(    fd: Number,     callback: (err: ErrnoException?, bytesRead: Double, <Error class: unknown class><out <Error class: unknown class>>) -> Unit)

external fun <TBuffer> read(    fd: Number,     options: ReadAsyncOptions<TBuffer>,     callback: (err: ErrnoException?, bytesRead: Double, buffer: TBuffer) -> Unit)

Similar to the above fs.read function, this version takes an optional options object. If not otherwise specified in an options object, buffer defaults to Buffer.alloc(16384), offset defaults to 0, length defaults to buffer.byteLength, - offset as of Node 17.6.0 position defaults to null

external fun <TBuffer> read(    fd: Number,     buffer: TBuffer,     offset: Number,     length: Number,     position: ReadPosition?,     callback: (err: ErrnoException?, bytesRead: Double, buffer: TBuffer) -> Unit)

Read data from the file specified by fd.

Link copied to clipboard
suspend external fun readdir(path: PathLike): <Error class: unknown class><String>
suspend external fun readdir(path: PathLike, options: ReaddirBufferAsyncOptions): <Error class: unknown class><Buffer<*>>

external fun readdir(path: PathLike, callback: (err: ErrnoException?, <Error class: unknown class><String>) -> Unit)
suspend external fun readdir(path: PathLike, options: String): <Error class: unknown class><Buffer<*>>
suspend external fun readdir(path: PathLike, options: ReaddirWithFileTypesAsyncOptions): <Error class: unknown class><Dirent>
external fun readdir(path: PathLike, options: String, callback: (err: ErrnoException?, <Error class: unknown class><Buffer<*>>) -> Unit)
external fun readdir(path: PathLike, options: BufferEncoding?, callback: (err: ErrnoException?, files: Any) -> Unit)
external fun readdir(    path: PathLike,     options: ReaddirBufferOptions,     callback: (err: ErrnoException?, <Error class: unknown class><Buffer<*>>) -> Unit)
external fun readdir(path: PathLike, options: ReaddirOptions?, callback: (err: ErrnoException?, files: Any) -> Unit)
external fun readdir(    path: PathLike,     options: ReaddirWithFileTypesOptions,     callback: (err: ErrnoException?, <Error class: unknown class><Dirent>) -> Unit)

Asynchronous readdir(3) - read a directory.

suspend external fun readdir(path: PathLike, options: BufferEncoding? = definedExternally): <Error class: unknown class><String>
suspend external fun readdir(path: PathLike, options: ReaddirAsyncOptions? = definedExternally): <Error class: unknown class><String>

Reads the contents of a directory.

external fun readdir(path: PathLike, options: BufferEncoding?, callback: (err: ErrnoException?, <Error class: unknown class><String>) -> Unit)
external fun readdir(path: PathLike, options: ReaddirStringOptions?, callback: (err: ErrnoException?, <Error class: unknown class><String>) -> Unit)

Reads the contents of a directory. The callback gets two arguments (err, files) where files is an array of the names of the files in the directory excluding '.' and '..'.

Link copied to clipboard
external fun readdirAsync(path: PathLike): <Error class: unknown class><<Error class: unknown class><String>>
external fun readdirAsync(    path: PathLike,     options: BufferEncoding? = definedExternally): <Error class: unknown class><<Error class: unknown class><String>>
external fun readdirAsync(    path: PathLike,     options: ReaddirAsyncOptions? = definedExternally): <Error class: unknown class><<Error class: unknown class><String>>

Reads the contents of a directory.

external fun readdirAsync(path: PathLike, options: String): <Error class: unknown class><<Error class: unknown class><Buffer<*>>>
external fun readdirAsync(    path: PathLike,     options: ReaddirBufferAsyncOptions): <Error class: unknown class><<Error class: unknown class><Buffer<*>>>
external fun readdirAsync(    path: PathLike,     options: ReaddirWithFileTypesAsyncOptions): <Error class: unknown class><<Error class: unknown class><Dirent>>

Asynchronous readdir(3) - read a directory.

Link copied to clipboard
external fun readdirSync(path: PathLike): <Error class: unknown class><String>
external fun readdirSync(path: PathLike, options: BufferEncoding? = definedExternally): <Error class: unknown class><String>
external fun readdirSync(path: PathLike, options: ReaddirSyncStringOptions? = definedExternally): <Error class: unknown class><String>

Reads the contents of the directory.

external fun readdirSync(path: PathLike, options: String): <Error class: unknown class><Buffer<*>>
external fun readdirSync(path: PathLike, options: ReaddirSyncBufferOptions): <Error class: unknown class><Buffer<*>>
external fun readdirSync(path: PathLike, options: ReaddirSyncOptions? = definedExternally): Any
external fun readdirSync(path: PathLike, options: ReaddirSyncWithFileTypesOptions): <Error class: unknown class><Dirent>

Synchronous readdir(3) - read a directory.

Link copied to clipboard
suspend external fun readFile(path: PathLike): Any
suspend external fun readFile(path: PathLike, options: ReadFileBufferAsyncOptions? = definedExternally): Buffer<*>
suspend external fun readFile(path: PathLike, options: ReadFileStringAsyncOptions): String

suspend external fun readFile(path: FileHandle): Any
external fun readFile(path: PathOrFileDescriptor, callback: (err: ErrnoException?, data: Buffer<*>) -> Unit)
suspend external fun readFile(path: PathLike, options: BufferEncoding): String
suspend external fun readFile(path: PathLike, options: BufferEncoding? = definedExternally): Any
suspend external fun readFile(path: PathLike, options: ReadFileAsyncOptions? = definedExternally): Any
suspend external fun readFile(path: FileHandle, options: BufferEncoding): String
suspend external fun readFile(path: FileHandle, options: BufferEncoding? = definedExternally): Any
suspend external fun readFile(path: FileHandle, options: ReadFileAsyncOptions? = definedExternally): Any
suspend external fun readFile(path: FileHandle, options: ReadFileBufferAsyncOptions? = definedExternally): Buffer<*>
suspend external fun readFile(path: FileHandle, options: ReadFileStringAsyncOptions): String
external fun readFile(path: PathOrFileDescriptor, options: BufferEncoding, callback: (err: ErrnoException?, data: String) -> Unit)
external fun readFile(path: PathOrFileDescriptor, options: BufferEncoding?, callback: (err: ErrnoException?, data: Any) -> Unit)
external fun readFile(path: PathOrFileDescriptor, options: ReadFileBufferOptions?, callback: (err: ErrnoException?, data: Buffer<*>) -> Unit)
external fun readFile(path: PathOrFileDescriptor, options: ReadFileOptions?, callback: (err: ErrnoException?, data: Any) -> Unit)
external fun readFile(path: PathOrFileDescriptor, options: ReadFileStringOptions, callback: (err: ErrnoException?, data: String) -> Unit)

Asynchronously reads the entire contents of a file.

Link copied to clipboard
external fun readFileAsync(path: PathLike): <Error class: unknown class><Any>
external fun readFileAsync(path: FileHandle): <Error class: unknown class><Any>
external fun readFileAsync(path: PathLike, options: BufferEncoding): <Error class: unknown class><String>
external fun readFileAsync(path: PathLike, options: BufferEncoding? = definedExternally): <Error class: unknown class><Any>
external fun readFileAsync(path: PathLike, options: ReadFileAsyncOptions? = definedExternally): <Error class: unknown class><Any>
external fun readFileAsync(path: PathLike, options: ReadFileBufferAsyncOptions? = definedExternally): <Error class: unknown class><Buffer<*>>
external fun readFileAsync(path: PathLike, options: ReadFileStringAsyncOptions): <Error class: unknown class><String>
external fun readFileAsync(path: FileHandle, options: BufferEncoding): <Error class: unknown class><String>
external fun readFileAsync(path: FileHandle, options: BufferEncoding? = definedExternally): <Error class: unknown class><Any>
external fun readFileAsync(path: FileHandle, options: ReadFileAsyncOptions? = definedExternally): <Error class: unknown class><Any>
external fun readFileAsync(path: FileHandle, options: ReadFileBufferAsyncOptions? = definedExternally): <Error class: unknown class><Buffer<*>>
external fun readFileAsync(path: FileHandle, options: ReadFileStringAsyncOptions): <Error class: unknown class><String>

Asynchronously reads the entire contents of a file.

Link copied to clipboard
external fun readFileSync(path: PathOrFileDescriptor, options: BufferEncoding? = definedExternally): Any
external fun readFileSync(path: PathOrFileDescriptor, options: ReadFileSyncOptions? = definedExternally): Any

Synchronously reads the entire contents of a file.

external fun readFileSync(path: PathOrFileDescriptor, options: ReadFileSyncBufferOptions? = definedExternally): Buffer<*>

Returns the contents of the path.

Link copied to clipboard
suspend external fun readlink(path: PathLike): String
suspend external fun readlink(path: PathLike, options: BufferEncodingOption): Buffer<*>

external fun readlink(path: PathLike, callback: (err: ErrnoException?, linkString: String) -> Unit)
suspend external fun readlink(path: PathLike, options: String? = definedExternally): Any
external fun readlink(path: PathLike, options: BufferEncodingOption, callback: (err: ErrnoException?, linkString: Buffer<*>) -> Unit)
external fun readlink(path: PathLike, options: EncodingOption, callback: (err: ErrnoException?, linkString: Any) -> Unit)

Asynchronous readlink(2) - read value of a symbolic link.

suspend external fun readlink(path: PathLike, options: BufferEncoding? = definedExternally): String
suspend external fun readlink(path: PathLike, options: ObjectEncodingOptions? = definedExternally): String

Reads the contents of the symbolic link referred to by path. See the POSIX readlink(2) documentation for more detail. The promise is fulfilled with thelinkString upon success.

external fun readlink(path: PathLike, options: EncodingOption, callback: (err: ErrnoException?, linkString: String) -> Unit)

Reads the contents of the symbolic link referred to by path. The callback gets two arguments (err, linkString).

Link copied to clipboard
external fun readlinkAsync(path: PathLike): <Error class: unknown class><String>
external fun readlinkAsync(path: PathLike, options: BufferEncoding? = definedExternally): <Error class: unknown class><String>
external fun readlinkAsync(path: PathLike, options: ObjectEncodingOptions? = definedExternally): <Error class: unknown class><String>

Reads the contents of the symbolic link referred to by path. See the POSIX readlink(2) documentation for more detail. The promise is fulfilled with thelinkString upon success.

external fun readlinkAsync(path: PathLike, options: BufferEncodingOption): <Error class: unknown class><Buffer<*>>
external fun readlinkAsync(path: PathLike, options: String? = definedExternally): <Error class: unknown class><Any>

Asynchronous readlink(2) - read value of a symbolic link.

Link copied to clipboard
external fun readlinkSync(path: PathLike): String
external fun readlinkSync(path: PathLike, options: BufferEncodingOption): Buffer<*>

Synchronous readlink(2) - read value of a symbolic link.

external fun readlinkSync(path: PathLike, options: EncodingOption = definedExternally): String

Returns the symbolic link's string value.

Link copied to clipboard
external fun readSync(    fd: Number,     buffer: <Error class: unknown class><out <Error class: unknown class>>,     opts: ReadSyncOptions = definedExternally): Double

Similar to the above fs.readSync function, this version takes an optional options object. If no options object is specified, it will default with the above values.

external fun readSync(    fd: Number,     buffer: <Error class: unknown class><out <Error class: unknown class>>,     offset: Number,     length: Number,     position: ReadPosition?): Double

Returns the number of bytesRead.

Link copied to clipboard
external fun readv(    fd: Number,     buffers: <Error class: unknown class><<Error class: unknown class><out <Error class: unknown class>>>,     cb: (err: ErrnoException?, bytesRead: Double, <Error class: unknown class><<Error class: unknown class><out <Error class: unknown class>>>) -> Unit)

Read from a file specified by fd and write to an array of ArrayBufferViews using readv().

external fun readv(    fd: Number,     buffers: <Error class: unknown class><<Error class: unknown class><out <Error class: unknown class>>>,     position: Number,     cb: (err: ErrnoException?, bytesRead: Double, <Error class: unknown class><<Error class: unknown class><out <Error class: unknown class>>>) -> Unit)
Link copied to clipboard
external fun readvSync(    fd: Number,     buffers: <Error class: unknown class><<Error class: unknown class><out <Error class: unknown class>>>,     position: Number = definedExternally): Double

For detailed information, see the documentation of the asynchronous version of this API: {@link readv}.

Link copied to clipboard
suspend external fun realpath(path: PathLike): String
suspend external fun realpath(path: PathLike, options: BufferEncodingOption): Buffer<*>

external fun realpath(path: PathLike, callback: (err: ErrnoException?, resolvedPath: String) -> Unit)
external fun realpath(path: PathLike, options: BufferEncodingOption, callback: (err: ErrnoException?, resolvedPath: Buffer<*>) -> Unit)
external fun realpath(path: PathLike, options: EncodingOption, callback: (err: ErrnoException?, resolvedPath: Any) -> Unit)

Asynchronous realpath(3) - return the canonicalized absolute pathname.

suspend external fun realpath(path: PathLike, options: BufferEncoding? = definedExternally): String
suspend external fun realpath(path: PathLike, options: ObjectEncodingOptions? = definedExternally): String

Determines the actual location of path using the same semantics as the fs.realpath.native() function.

external fun realpath(path: PathLike, options: EncodingOption, callback: (err: ErrnoException?, resolvedPath: String) -> Unit)

Asynchronously computes the canonical pathname by resolving ., .., and symbolic links.

Link copied to clipboard
external fun realpathAsync(path: PathLike): <Error class: unknown class><String>
external fun realpathAsync(path: PathLike, options: BufferEncoding? = definedExternally): <Error class: unknown class><String>
external fun realpathAsync(path: PathLike, options: ObjectEncodingOptions? = definedExternally): <Error class: unknown class><String>

Determines the actual location of path using the same semantics as the fs.realpath.native() function.

external fun realpathAsync(path: PathLike, options: BufferEncodingOption): <Error class: unknown class><Buffer<*>>

Asynchronous realpath(3) - return the canonicalized absolute pathname.

Link copied to clipboard
external fun realpathSync(path: PathLike): String
external fun realpathSync(path: PathLike, options: BufferEncodingOption): Buffer<*>

Synchronous realpath(3) - return the canonicalized absolute pathname.

external fun realpathSync(path: PathLike, options: EncodingOption = definedExternally): String

Returns the resolved pathname.

Link copied to clipboard
suspend external fun rename(oldPath: PathLike, newPath: PathLike): <Error class: unknown class>

external fun rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback)

Asynchronously rename file at oldPath to the pathname provided as newPath. In the case that newPath already exists, it will be overwritten. If there is a directory at newPath, an error will be raised instead. No arguments other than a possible exception are given to the completion callback.

Link copied to clipboard
external fun renameAsync(oldPath: PathLike, newPath: PathLike): <Error class: unknown class><<Error class: unknown class>>

Renames oldPath to newPath.

Link copied to clipboard
external fun renameSync(oldPath: PathLike, newPath: PathLike)

Renames the file from oldPath to newPath. Returns undefined.

Link copied to clipboard
external fun rm(path: PathLike, callback: NoParamCallback)

Asynchronously removes files and directories (modeled on the standard POSIX rm utility). No arguments other than a possible exception are given to the completion callback.

suspend external fun rm(path: PathLike, options: RmOptions = definedExternally): <Error class: unknown class>
external fun rm(path: PathLike, options: RmOptions, callback: NoParamCallback)
Link copied to clipboard
external fun rmAsync(path: PathLike, options: RmOptions = definedExternally): <Error class: unknown class><<Error class: unknown class>>

Removes files and directories (modeled on the standard POSIX rm utility).

Link copied to clipboard
external fun rmdir(path: PathLike, callback: NoParamCallback)

Asynchronous rmdir(2). No arguments other than a possible exception are given to the completion callback.

suspend external fun rmdir(path: PathLike, options: RmDirOptions = definedExternally): <Error class: unknown class>
external fun rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback)
Link copied to clipboard
external fun rmdirAsync(path: PathLike, options: RmDirOptions = definedExternally): <Error class: unknown class><<Error class: unknown class>>

Removes the directory identified by path.

Link copied to clipboard
external fun rmdirSync(path: PathLike, options: RmDirOptions = definedExternally)

Synchronous rmdir(2). Returns undefined.

Link copied to clipboard
external fun rmSync(path: PathLike, options: RmOptions = definedExternally)

Synchronously removes files and directories (modeled on the standard POSIX rm utility). Returns undefined.

Link copied to clipboard
suspend external fun stat(path: PathLike): Stats
suspend external fun stat(path: PathLike, opts: StatBigIntOpts): BigIntStats
suspend external fun stat(path: PathLike, opts: StatOptions = definedExternally): Any
suspend external fun stat(path: PathLike, opts: StatSimpleOpts = definedExternally): Stats
external fun stat(path: PathLike, options: StatBigIntOptions, callback: (err: ErrnoException?, stats: BigIntStats) -> Unit)
external fun stat(path: PathLike, options: StatOptions?, callback: (err: ErrnoException?, stats: Any) -> Unit)
external fun stat(path: PathLike, options: StatSimpleOptions?, callback: (err: ErrnoException?, stats: Stats) -> Unit)

external fun stat(path: PathLike, callback: (err: ErrnoException?, stats: Stats) -> Unit)

Asynchronous stat(2). The callback gets two arguments (err, stats) wherestats is an fs.Stats object.

Link copied to clipboard
external fun statAsync(path: PathLike): <Error class: unknown class><Stats>
external fun statAsync(path: PathLike, opts: StatBigIntOpts): <Error class: unknown class><BigIntStats>
external fun statAsync(path: PathLike, opts: StatOptions = definedExternally): <Error class: unknown class><Any>
external fun statAsync(path: PathLike, opts: StatSimpleOpts = definedExternally): <Error class: unknown class><Stats>
Link copied to clipboard
suspend external fun statfs(path: PathLike): StatsFs
suspend external fun statfs(path: PathLike, opts: StatFsOptions = definedExternally): Any
suspend external fun statfs(path: PathLike, opts: StatfsBigIntOpts): BigIntStatsFs
suspend external fun statfs(path: PathLike, opts: StatfsOpts = definedExternally): StatsFs
external fun statfs(path: PathLike, options: StatFsOptions?, callback: (err: ErrnoException?, stats: Any) -> Unit)
external fun statfs(path: PathLike, options: StatfsBigIntOptions, callback: (err: ErrnoException?, stats: BigIntStatsFs) -> Unit)
external fun statfs(path: PathLike, options: StatfsOptions?, callback: (err: ErrnoException?, stats: StatsFs) -> Unit)

external fun statfs(path: PathLike, callback: (err: ErrnoException?, stats: StatsFs) -> Unit)

Asynchronous statfs(2). Returns information about the mounted file system which contains path. The callback gets two arguments (err, stats) where statsis an fs.StatFs object.

Link copied to clipboard
external fun statfsAsync(path: PathLike): <Error class: unknown class><StatsFs>
external fun statfsAsync(path: PathLike, opts: StatFsOptions = definedExternally): <Error class: unknown class><Any>
external fun statfsAsync(path: PathLike, opts: StatfsBigIntOpts): <Error class: unknown class><BigIntStatsFs>
external fun statfsAsync(path: PathLike, opts: StatfsOpts = definedExternally): <Error class: unknown class><StatsFs>
Link copied to clipboard
external fun statfsSync(path: PathLike): StatsFs
external fun statfsSync(path: PathLike, options: StatFsOptions = definedExternally): Any

external fun statfsSync(path: PathLike, options: StatfsSyncOptions = definedExternally): StatsFs

Synchronous statfs(2). Returns information about the mounted file system which contains path.

Link copied to clipboard
external fun symlink(target: PathLike, path: PathLike, callback: NoParamCallback)

Asynchronous symlink(2) - Create a new symbolic link to an existing file.

suspend external fun symlink(target: PathLike, path: PathLike, type: String? = definedExternally): <Error class: unknown class>

external fun symlink(target: PathLike, path: PathLike, type: SymlinkType?, callback: NoParamCallback)

Creates the link called path pointing to target. No arguments other than a possible exception are given to the completion callback.

Link copied to clipboard
external fun symlinkAsync(    target: PathLike,     path: PathLike,     type: String? = definedExternally): <Error class: unknown class><<Error class: unknown class>>

Creates a symbolic link.

Link copied to clipboard
external fun symlinkSync(target: PathLike, path: PathLike, type: SymlinkType? = definedExternally)

Returns undefined.

Link copied to clipboard
external fun truncate(path: PathLike, callback: NoParamCallback)

Asynchronous truncate(2) - Truncate a file to a specified length.

suspend external fun truncate(path: PathLike, len: Number = definedExternally): <Error class: unknown class>

external fun truncate(path: PathLike, len: Double?, callback: NoParamCallback)

Truncates the file. No arguments other than a possible exception are given to the completion callback. A file descriptor can also be passed as the first argument. In this case, fs.ftruncate() is called.

Link copied to clipboard
external fun truncateAsync(path: PathLike, len: Number = definedExternally): <Error class: unknown class><<Error class: unknown class>>

Truncates (shortens or extends the length) of the content at path to len bytes.

Link copied to clipboard
external fun truncateSync(path: PathLike, len: Double? = definedExternally)

Truncates the file. Returns undefined. A file descriptor can also be passed as the first argument. In this case, fs.ftruncateSync() is called.

Link copied to clipboard
suspend external fun unlink(path: PathLike): <Error class: unknown class>

external fun unlink(path: PathLike, callback: NoParamCallback)

Asynchronously removes a file or symbolic link. No arguments other than a possible exception are given to the completion callback.

Link copied to clipboard
external fun unlinkAsync(path: PathLike): <Error class: unknown class><<Error class: unknown class>>

If path refers to a symbolic link, then the link is removed without affecting the file or directory to which that link refers. If the path refers to a file path that is not a symbolic link, the file is deleted. See the POSIX unlink(2) documentation for more detail.

Link copied to clipboard
external fun unlinkSync(path: PathLike)

Synchronous unlink(2). Returns undefined.

Link copied to clipboard
external fun unwatchFile(filename: PathLike)
external fun unwatchFile(filename: PathLike, listener: BigIntStatsListener = definedExternally)

external fun unwatchFile(filename: PathLike, listener: StatsListener = definedExternally)

Stop watching for changes on filename. If listener is specified, only that particular listener is removed. Otherwise, all listeners are removed, effectively stopping watching of filename.

Link copied to clipboard
suspend external fun utimes(path: PathLike, atime: TimeLike, mtime: TimeLike): <Error class: unknown class>

external fun utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback)

Change the file system timestamps of the object referenced by path.

Link copied to clipboard
external fun utimesAsync(path: PathLike, atime: TimeLike, mtime: TimeLike): <Error class: unknown class><<Error class: unknown class>>

Change the file system timestamps of the object referenced by path.

Link copied to clipboard
external fun utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike)

Returns undefined.

Link copied to clipboard
external fun watch(filename: PathLike): <Error class: unknown class><FileChangeInfo<String>>
external fun watch(filename: PathLike, listener: WatchListener<String> = definedExternally): FSWatcher
external fun watch(filename: PathLike, options: String): Any
external fun watch(filename: PathLike, options: BufferEncoding = definedExternally): <Error class: unknown class><FileChangeInfo<String>>
external fun watch(filename: PathLike, options: WatchOptions = definedExternally): <Error class: unknown class><FileChangeInfo<String>>
external fun watch(filename: PathLike, options: String, listener: WatchListener<Any> = definedExternally): FSWatcher
external fun watch(filename: PathLike, options: BufferEncoding? = definedExternally, listener: WatchListener<String> = definedExternally): FSWatcher
external fun watch(filename: PathLike, options: WatchOptions, listener: WatchListener<Any> = definedExternally): FSWatcher
external fun watch(filename: PathLike, options: WatchOptions? = definedExternally, listener: WatchListener<String> = definedExternally): FSWatcher

Watch for changes on filename, where filename is either a file or a directory, returning an FSWatcher.

external fun watch(filename: PathLike, options: WatchBufferAsyncOptions): <Error class: unknown class><FileChangeInfo<Buffer<*>>>

Returns an async iterator that watches for changes on filename, where filenameis either a file or a directory.

external fun watch(filename: PathLike, options: String, listener: WatchListener<Buffer<*>> = definedExternally): FSWatcher
external fun watch(filename: PathLike, options: WatchBufferOptions, listener: WatchListener<Buffer<*>> = definedExternally): FSWatcher

Watch for changes on filename, where filename is either a file or a directory.

Link copied to clipboard
external fun watchFile(filename: PathLike, listener: StatsListener): StatWatcher
external fun watchFile(filename: PathLike, options: WatchFileSimpleOptions?, listener: StatsListener): StatWatcher

Watch for changes on filename. The callback listener will be called each time the file is accessed.

external fun watchFile(filename: PathLike, options: WatchFileBigIntOptions?, listener: BigIntStatsListener): StatWatcher
Link copied to clipboard
external fun <TBuffer> write(fd: Number, buffer: TBuffer, callback: (err: ErrnoException?, written: Double, buffer: TBuffer) -> Unit)
external fun <TBuffer> write(fd: Number, buffer: TBuffer, offset: Double?, callback: (err: ErrnoException?, written: Double, buffer: TBuffer) -> Unit)
external fun <TBuffer> write(    fd: Number,     buffer: TBuffer,     offset: Double?,     length: Double?,     callback: (err: ErrnoException?, written: Double, buffer: TBuffer) -> Unit)

Asynchronously writes buffer to the file referenced by the supplied file descriptor.

external fun write(fd: Number, string: String, callback: (err: ErrnoException?, written: Double, str: String) -> Unit)
external fun write(fd: Number, string: String, position: Double?, callback: (err: ErrnoException?, written: Double, str: String) -> Unit)
external fun write(    fd: Number,     string: String,     position: Double?,     encoding: BufferEncoding?,     callback: (err: ErrnoException?, written: Double, str: String) -> Unit)

Asynchronously writes string to the file referenced by the supplied file descriptor.

external fun <TBuffer> write(    fd: Number,     buffer: TBuffer,     offset: Double?,     length: Double?,     position: Double?,     callback: (err: ErrnoException?, written: Double, buffer: TBuffer) -> Unit)

Write buffer to the file specified by fd.

Link copied to clipboard
suspend external fun writeFile(file: PathLike, data: <Error class: unknown class><Any>): <Error class: unknown class>
suspend external fun writeFile(file: PathLike, data: <Error class: unknown class><out <Error class: unknown class>>): <Error class: unknown class>
suspend external fun writeFile(file: PathLike, data: <Error class: unknown class><Any>): <Error class: unknown class>
suspend external fun writeFile(file: PathLike, data: Stream): <Error class: unknown class>
suspend external fun writeFile(file: FileHandle, data: <Error class: unknown class><Any>): <Error class: unknown class>
suspend external fun writeFile(file: FileHandle, data: <Error class: unknown class><out <Error class: unknown class>>): <Error class: unknown class>
suspend external fun writeFile(file: FileHandle, data: <Error class: unknown class><Any>): <Error class: unknown class>
suspend external fun writeFile(file: FileHandle, data: String): <Error class: unknown class>
suspend external fun writeFile(file: FileHandle, data: Stream): <Error class: unknown class>
suspend external fun writeFile(    file: PathLike,     data: <Error class: unknown class><Any>,     options: BufferEncoding? = definedExternally): <Error class: unknown class>
suspend external fun writeFile(    file: PathLike,     data: <Error class: unknown class><Any>,     options: WriteFileAsyncOptions? = definedExternally): <Error class: unknown class>
suspend external fun writeFile(    file: PathLike,     data: <Error class: unknown class><out <Error class: unknown class>>,     options: BufferEncoding? = definedExternally): <Error class: unknown class>
suspend external fun writeFile(    file: PathLike,     data: <Error class: unknown class><out <Error class: unknown class>>,     options: WriteFileAsyncOptions? = definedExternally): <Error class: unknown class>
suspend external fun writeFile(    file: PathLike,     data: <Error class: unknown class><Any>,     options: BufferEncoding? = definedExternally): <Error class: unknown class>
suspend external fun writeFile(    file: PathLike,     data: <Error class: unknown class><Any>,     options: WriteFileAsyncOptions? = definedExternally): <Error class: unknown class>
suspend external fun writeFile(file: PathLike, data: String, options: BufferEncoding? = definedExternally): <Error class: unknown class>
suspend external fun writeFile(file: PathLike, data: String, options: WriteFileAsyncOptions? = definedExternally): <Error class: unknown class>
suspend external fun writeFile(file: PathLike, data: Stream, options: BufferEncoding? = definedExternally): <Error class: unknown class>
suspend external fun writeFile(file: PathLike, data: Stream, options: WriteFileAsyncOptions? = definedExternally): <Error class: unknown class>
suspend external fun writeFile(    file: FileHandle,     data: <Error class: unknown class><Any>,     options: BufferEncoding? = definedExternally): <Error class: unknown class>
suspend external fun writeFile(    file: FileHandle,     data: <Error class: unknown class><Any>,     options: WriteFileAsyncOptions? = definedExternally): <Error class: unknown class>
suspend external fun writeFile(    file: FileHandle,     data: <Error class: unknown class><out <Error class: unknown class>>,     options: BufferEncoding? = definedExternally): <Error class: unknown class>
suspend external fun writeFile(    file: FileHandle,     data: <Error class: unknown class><out <Error class: unknown class>>,     options: WriteFileAsyncOptions? = definedExternally): <Error class: unknown class>
suspend external fun writeFile(    file: FileHandle,     data: <Error class: unknown class><Any>,     options: BufferEncoding? = definedExternally): <Error class: unknown class>
suspend external fun writeFile(    file: FileHandle,     data: <Error class: unknown class><Any>,     options: WriteFileAsyncOptions? = definedExternally): <Error class: unknown class>
suspend external fun writeFile(file: FileHandle, data: String, options: BufferEncoding? = definedExternally): <Error class: unknown class>
suspend external fun writeFile(file: FileHandle, data: String, options: WriteFileAsyncOptions? = definedExternally): <Error class: unknown class>
suspend external fun writeFile(file: FileHandle, data: Stream, options: BufferEncoding? = definedExternally): <Error class: unknown class>
suspend external fun writeFile(file: FileHandle, data: Stream, options: WriteFileAsyncOptions? = definedExternally): <Error class: unknown class>

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.

suspend external fun writeFile(file: PathLike, data: String): <Error class: unknown class>

external fun writeFile(path: PathOrFileDescriptor, data: <Error class: unknown class><out <Error class: unknown class>>, callback: NoParamCallback)
external fun writeFile(path: PathOrFileDescriptor, data: String, callback: NoParamCallback)

Asynchronously writes data to a file, replacing the file if it already exists.

external fun writeFile(    file: PathOrFileDescriptor,     data: <Error class: unknown class><out <Error class: unknown class>>,     options: WriteFileOptions,     callback: NoParamCallback)
external fun writeFile(file: PathOrFileDescriptor, data: String, options: WriteFileOptions, callback: NoParamCallback)

When file is a filename, asynchronously writes data to the file, replacing the file if it already exists. data can be a string or a buffer.

Link copied to clipboard
external fun writeFileAsync(file: PathLike, data: <Error class: unknown class><Any>): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(    file: PathLike,     data: <Error class: unknown class><out <Error class: unknown class>>): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(file: PathLike, data: <Error class: unknown class><Any>): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(file: PathLike, data: String): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(file: PathLike, data: Stream): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(file: FileHandle, data: <Error class: unknown class><Any>): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(    file: FileHandle,     data: <Error class: unknown class><out <Error class: unknown class>>): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(file: FileHandle, data: <Error class: unknown class><Any>): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(file: FileHandle, data: String): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(file: FileHandle, data: Stream): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(    file: PathLike,     data: <Error class: unknown class><Any>,     options: BufferEncoding? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(    file: PathLike,     data: <Error class: unknown class><Any>,     options: WriteFileAsyncOptions? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(    file: PathLike,     data: <Error class: unknown class><out <Error class: unknown class>>,     options: BufferEncoding? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(    file: PathLike,     data: <Error class: unknown class><out <Error class: unknown class>>,     options: WriteFileAsyncOptions? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(    file: PathLike,     data: <Error class: unknown class><Any>,     options: BufferEncoding? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(    file: PathLike,     data: <Error class: unknown class><Any>,     options: WriteFileAsyncOptions? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(    file: PathLike,     data: String,     options: BufferEncoding? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(    file: PathLike,     data: String,     options: WriteFileAsyncOptions? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(    file: PathLike,     data: Stream,     options: BufferEncoding? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(    file: PathLike,     data: Stream,     options: WriteFileAsyncOptions? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(    file: FileHandle,     data: <Error class: unknown class><Any>,     options: BufferEncoding? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(    file: FileHandle,     data: <Error class: unknown class><Any>,     options: WriteFileAsyncOptions? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(    file: FileHandle,     data: <Error class: unknown class><out <Error class: unknown class>>,     options: BufferEncoding? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(    file: FileHandle,     data: <Error class: unknown class><out <Error class: unknown class>>,     options: WriteFileAsyncOptions? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(    file: FileHandle,     data: <Error class: unknown class><Any>,     options: BufferEncoding? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(    file: FileHandle,     data: <Error class: unknown class><Any>,     options: WriteFileAsyncOptions? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(    file: FileHandle,     data: String,     options: BufferEncoding? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(    file: FileHandle,     data: String,     options: WriteFileAsyncOptions? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(    file: FileHandle,     data: Stream,     options: BufferEncoding? = definedExternally): <Error class: unknown class><<Error class: unknown class>>
external fun writeFileAsync(    file: FileHandle,     data: Stream,     options: WriteFileAsyncOptions? = definedExternally): <Error class: unknown class><<Error class: unknown class>>

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.

Link copied to clipboard
external fun writeFileSync(    file: PathOrFileDescriptor,     data: <Error class: unknown class><out <Error class: unknown class>>,     options: WriteFileOptions = definedExternally)
external fun writeFileSync(file: PathOrFileDescriptor, data: String, options: WriteFileOptions = definedExternally)

Returns undefined.

Link copied to clipboard
external fun writeSync(fd: Number, string: String, position: Double? = definedExternally, encoding: BufferEncoding? = definedExternally): Double

Synchronously writes string to the file referenced by the supplied file descriptor, returning the number of bytes written.

external fun writeSync(    fd: Number,     buffer: <Error class: unknown class><out <Error class: unknown class>>,     offset: Double? = definedExternally,     length: Double? = definedExternally,     position: Double? = definedExternally): Double

For detailed information, see the documentation of the asynchronous version of this API: {@link write}.

Link copied to clipboard
external fun writev(    fd: Number,     buffers: <Error class: unknown class><<Error class: unknown class><out <Error class: unknown class>>>,     cb: (err: ErrnoException?, bytesWritten: Double, <Error class: unknown class><<Error class: unknown class><out <Error class: unknown class>>>) -> Unit)

Write an array of ArrayBufferViews to the file specified by fd using writev().

external fun writev(    fd: Number,     buffers: <Error class: unknown class><<Error class: unknown class><out <Error class: unknown class>>>,     position: Number,     cb: (err: ErrnoException?, bytesWritten: Double, <Error class: unknown class><<Error class: unknown class><out <Error class: unknown class>>>) -> Unit)
Link copied to clipboard
external fun writevSync(    fd: Number,     buffers: <Error class: unknown class><<Error class: unknown class><out <Error class: unknown class>>>,     position: Number = definedExternally): Double

For detailed information, see the documentation of the asynchronous version of this API: {@link writev}.