Skip to main content
Compatibility: Only available on Node.js.
This notebook provides a quick overview for getting started with DirectoryLoader document loaders. For detailed documentation of all DirectoryLoader features and configurations head to the API reference. This example goes over how to load data from folders with multiple files. The second argument is a map of file extensions to loader factories. Each file will be passed to the matching loader, and the resulting documents will be concatenated together. Example folder:

Overview

Integration details

Setup

To access DirectoryLoader document loader you’ll need to install the langchain package.

Installation

The LangChain DirectoryLoader integration lives in the langchain package:

Instantiation

Now we can instantiate our model object and load documents:
The @langchain/community package is no longer maintained. Examples that import from @langchain/community may be outdated or broken. Use with caution.

Load


API reference

For detailed documentation of all DirectoryLoader features and configurations head to the API reference.