readFileSync

abstract fun readFileSync(path: Value, options: Value? = null): StringOrBuffer
abstract fun readFileSync(path: Path, options: ReadFileOptions = ReadFileOptions.DEFAULTS): StringOrBuffer

Method: fs.readFileSync

Reads the contents of a file at the specified path and returns the results synchronously. This variant accepts a plain Value.

Return

The contents of the file as a Buffer.

Parameters

path

The path to the file to read.

options

The options to use for the file read operation.