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

Chat LangChain

What can I help with?

Enter to send·Shift+Enter new line

Menu

OverviewAgentMiddlewareBackendsSandboxesSkillsSubagentsTypes
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
Vitest
Language
Theme
JavaScriptdeepagentsindexCompositeBackendedit
Method●Since v1.6

edit

Edit a file, routing to appropriate backend.

Copy
edit(
  filePath: string,
  oldString: string,
  newString: string,
  replaceAll: boolean = false
): Promise<EditResult>

Parameters

NameTypeDescription
filePath*string

Absolute file path

oldString*string

String to find and replace

newString*string

Replacement string

replaceAllboolean
Default:false

If true, replace all occurrences

View source on GitHub