Skip to content

DataAdapter.writeBinary method

DataAdapter › writeBinary

Official

Write to a binary file. If the file exists its content will be overwritten, otherwise the file will be created.

Signature:

writeBinary(normalizedPath: string, data: ArrayBuffer, options?: DataWriteOptions | undefined): Promise<void>

Parameters:

ParameterTypeDescription
normalizedPathstringpath to file, use {@link normalizePath} to normalize beforehand.
dataArrayBufferthe file content.
options?DataWriteOptions | undefinedwrite options.

Returns: Promise<void>

Example:

const response = await requestUrl('https://example.com/image.png');
await adapter.writeBinary('image.png', response.arrayBuffer);