- readFile(path, options?): Promise<Buffer>
Parameters
- path: PathLike | FileHandle
Optional
options: null | {
encoding?: null;
flag?: OpenMode;
}
Returns Promise<Buffer>
the file data
- readFile(path, options): Promise<string>
Parameters
- path: PathLike | FileHandle
- options: BufferEncoding | {
encoding: BufferEncoding;
flag?: OpenMode | undefined;
}
Returns Promise<string>
- readFile(path, options?): Promise<string | Buffer>
Parameters
- path: PathLike | FileHandle
Optional
options: null | BufferEncoding | ObjectEncodingOptions & {
flag?: OpenMode | undefined;
}
Returns Promise<string | Buffer>
Asynchronously reads the entire contents of a file.