Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/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

ParameterTypeDescription
filePathstringThe relative or absolute path to the file whose contents should be read.

Returns:

Buffer