| hide_title | true |
|---|---|
| custom_edit_url | |
| pagination_prev | |
| pagination_next |
Home > @rushstack/node-core-library > FileSystem > writeBuffersToFile
Writes the contents of multiple Uint8Arrays to a file on disk, overwriting the file if it already exists. Behind the scenes it uses fs.writevSync()<></>.
This API is useful for writing large files efficiently, especially if the input is being concatenated from multiple sources.
Signature:
static writeBuffersToFile(filePath: string, contents: ReadonlyArray<NodeJS.ArrayBufferView>, options?: IFileSystemWriteBinaryFileOptions): void;|
Parameter |
Type |
Description |
|---|---|---|
|
filePath |
string |
The absolute or relative path of the file. |
|
contents |
ReadonlyArray<NodeJS.ArrayBufferView> |
The content that should be written to the file. |
|
options |
(Optional) Optional settings that can change the behavior. |
Returns:
void
Throws an error if the folder doesn't exist, unless IFileSystemWriteFileOptionsBase.ensureFolderExists is set to true<></>.