UNPKG

office-text-extractor-browser

Version:

Fork of office-text-extractor with unreleased changes that include browser support

8 lines (7 loc) 386 B
// source/util.ts // Utility functions to help with the handling of input. // import { readFile as read } from 'node:fs/promises'; import { Buffer } from 'buffer/index.js'; // export const readFile = async (filePath: string): Promise<Buffer> => // (await read(filePath)) as unknown as Buffer; export const fetchUrl = async (url) => Buffer.from(await (await fetch(url)).arrayBuffer());