office-text-extractor-browser
Version:
Fork of office-text-extractor with unreleased changes that include browser support
33 lines (28 loc) • 805 B
text/typescript
// source/index.ts
// This file contains the public API for the library.
import { TextExtractor } from './lib.js'
import { PdfExtractor } from './parsers/pdf.js'
import { DocExtractor } from './parsers/doc.js'
import { PptExtractor } from './parsers/ppt.js'
import { ExcelExtractor } from './parsers/excel.js'
/**
* Create and returns a text extractor instance with the default extraction
* methods.
*/
export const getTextExtractor = (): TextExtractor => {
const textExtractor = new TextExtractor()
const methods = [
new PdfExtractor(),
new DocExtractor(),
new PptExtractor(),
new ExcelExtractor(),
]
methods.map((method) => textExtractor.addMethod(method))
return textExtractor
}
export type {
InputType,
ExtractionPayload,
TextExtractionMethod,
TextExtractor,
} from './lib.js'