A class that extends the BaseDocumentLoader class. It represents a document loader that loads documents from a text file. The load() method is implemented to read the text from the file or blob, parse it using the parse() method, and create a Document instance for each parsed page. The metadata includes the source of the text (file path or blob) and, if there are multiple pages, the line number of each page.

const loader = new TextLoader("src/document_loaders/example_data/example.txt");
const docs = await loader.load();

Hierarchy (view full)

Constructors

Constructors