Skip to content

toArrayBuffer

Converts a File object to an ArrayBuffer.

Usage

ts
import { toArrayBuffer } from 'rattail'

await toArrayBuffer(new File(['Hello, world!'], 'hello.txt', { type: 'text/plain' }))
// return ArrayBuffer

Arguments

ArgTypeDefaults
fileFile

Return

Type
Promise<ArrayBuffer>