LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Agent
  • Middleware
  • Backends
  • Sandboxes
  • Skills
  • Subagents
  • Configuration
  • Types
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
  • Vitest
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewAgentMiddlewareBackendsSandboxesSkillsSubagentsConfigurationTypes
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
Vitest
Language
Theme
JavaScriptdeepagentsbackendsglobSearchFiles
Function●Since v1.4

globSearchFiles

Search files dict for paths matching glob pattern.

Copy
globSearchFiles(
  files: Record<string, FileData>,
  pattern: string,
  path: string = "/"
): string

Parameters

NameTypeDescription
files*Record<string, FileData>

Dictionary of file paths to FileData

pattern*string

Glob pattern (e.g., *.py, **/*.ts)

pathstring
Default:"/"

Base path to search from

Example

Copy
const files = {"/src/main.py": FileData(...), "/test.py": FileData(...)};
globSearchFiles(files, "*.py", "/");
// Returns: "/test.py\n/src/main.py" (sorted by modified_at)
View source on GitHub