File size: 317 Bytes
1185ec1
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13

export async function downloadPlainText(url: string): Promise<string> {
  // Fetch the plain text file
  const response = await fetch(url)

  if (!response.ok) {
    throw new Error(`Failed to download the plain/text file: ${response.statusText}`)
  }

  const plainText = await response.text()

  return plainText
}