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

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewAgentMiddlewareBackendsSandboxesSkillsSubagentsTypes
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
Vitest
Language
Theme
JavaScriptdeepagentsbackendsformatContentWithLineNumbers
Function●Since v1.5

formatContentWithLineNumbers

Format file content with line numbers (cat -n style).

Lines longer than MAX_LINE_LENGTH are split into continuation rows such as 5.1 and 5.2. Use formatContentWithLineNumbersAndBoundaries when a caller also needs safe source-line truncation points.

Copy
formatContentWithLineNumbers(content: string | string[], startLine: number = 1): string

Parameters

NameTypeDescription
content*string | string[]
startLinenumber
Default:1
View source on GitHub