writeFileSync

abstract fun writeFileSync(path: Value, data: Value)

Method: fs.writeFileSync

Writes the contents of a file at the specified path; provides the results or an error to the callback. This variant accepts a polyglot Value.

Parameters

path

The path to the file to write.

data

The data to write to the file.


abstract fun writeFileSync(path: Value, data: Value, options: Value?)

Method: fs.writeFileSync

Writes the contents of a file at the specified path; provides the results or an error to the callback. This variant accepts a polyglot Value.

Parameters

path

The path to the file to write.

data

The data to write to the file.

options

The options to use for the file write operation.


abstract fun writeFileSync(path: Path, data: ByteArray, options: WriteFileOptions = WriteFileOptions.DEFAULTS)

Method: fs.writeFileSync

Writes the contents of a file at the specified path synchronously; throws if an error prevents the file from being written. This variant accepts a ByteArray.

Parameters

path

The path to the file to write.

data

The data to write to the file.

options

The options to use for the file write operation.


abstract fun writeFileSync(path: Path, data: String, options: WriteFileOptions = WriteFileOptions.DEFAULTS)

Method: fs.writeFileSync

Writes the contents of a file at the specified path synchronously; throws if an error prevents the file from being written. This variant accepts a String.

Parameters

path

The path to the file to write.

data

The data to write to the file.

options

The options to use for the file write operation.