ReadOptions: undefined | {
    flag?: string;
} | {
    encoding: string;
    flag?: string;
}

It reads a file and returns its content as a string using the utf-8 encoding.

Type declaration

  • Optional flag?: string

Type declaration

  • encoding: string
  • Optional flag?: string

Param: path

Path to the file to read.

Returns

A promise that resolves with the content of the file.