Skip to main content

Text files

This example goes over how to load data from text files.

import { TextLoader } from "langchain/document_loaders/fs/text";

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

const docs = await loader.load();

Help us out by providing feedback on this documentation page: