office-text-extractor-browser
Version:
Fork of office-text-extractor with unreleased changes that include browser support
11 lines (8 loc) • 414 B
text/typescript
// 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: string): Promise<Buffer> =>
Buffer.from(await (await fetch(url)).arrayBuffer());