File size: 304 Bytes
142ad12
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
// hf-space/src/lib/knowledge/parser/docx.ts

import mammoth from 'mammoth';
import type { ParsedDocument } from './index';

export async function parseDOCX(buffer: Buffer): Promise<ParsedDocument> {
  const result = await mammoth.extractRawText({ buffer });
  return {
    content: result.value,
  };
}