fs.readFile

Method fs.readFile() reads the entire contents of a file.

Syntax

fs.readFile(filePath)

Parameters

filePath

Absolute or relative path to the file (string)

Return value

File contents (string) or null when error happened.