Loads the documents from the directory. If a file is a directory and
recursive
is true
, it recursively loads documents from the
subdirectory. If a file is a file, it checks if there is a
corresponding loader function for the file extension in the loaders
mapping. If there is, it loads the documents. If there is no
corresponding loader function and unknown
is set to Warn
, it logs a
warning message. If unknown
is set to Error
, it throws an error.
A promise that resolves to an array of loaded documents.
Loads the documents and splits them using a specified text splitter.
A Promise that resolves with an array of Document instances, each split according to the provided TextSplitter.
Static
importsImports the necessary functions from the node:path
and
node:fs/promises
modules. It is used to dynamically import the
functions when needed. If the import fails, it throws an error
indicating that the modules failed to load.
A promise that resolves to an object containing the imported functions.
Generated using TypeDoc
A class that extends the DirectoryLoader class. It represents a document loader that loads documents from a directory in the Notion format. It uses the TextLoader for loading '.md' files and ignores unknown file types.