Skip to content

toText ​

Converts a File object to a text string.

Usage ​

ts
import { toText } from 'rattail'

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

Arguments ​

ArgTypeDefaults
fileFile

Return ​

Type
Promise<string>