Skip to content

armgit / papra

Public Imported from GitHub
0

The minimalistic document archiving platform.

325 B
Raw Blame
import JSZip from 'jszip';

export async function getFileContentFromArchive({
  arrayBuffer,
  filePath,
}: {
  arrayBuffer: ArrayBuffer;
  filePath: string;
}): Promise<string | undefined> {
  const zip = await JSZip.loadAsync(arrayBuffer);

  const document = await zip.file(filePath)?.async('text');

  return document;
}