Home > @microsoft/node-core-library > FileSystem > readFileToBuffer

FileSystem.readFileToBuffer() method

Reads the contents of a file into a buffer. Behind the scenes is uses fs.readFileSync().

Signature:

static readFileToBuffer(filePath: string): Buffer;

Parameters

Parameter Type Description
filePath string The relative or absolute path to the file whose contents should be read.

Returns:

Buffer