readFile

abstract fun readFile(path: Value, options: Value?, callback: ReadFileCallback? = null)

Method: fs.readFile

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

Note: If the final cbk parameter is null, options will be inferred as the callback, and so must be executable in this case.

Parameters

path

The path to the file to read.

options

The options to use for the file read operation.

callback

The callback to provide the results or an error.


abstract fun readFile(path: Path, options: ReadFileOptions = ReadFileOptions.DEFAULTS, callback: ReadFileCallback)

Method: fs.readFile

Reads 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 read.

options

The options to use for the file read operation.

callback

The callback to provide the results or an error.