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
JavaScriptdeepagentsbackendsformatContentWithLineNumbers
Function●Since v1.4

formatContentWithLineNumbers

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

Chunks lines longer than MAX_LINE_LENGTH with continuation markers (e.g., 5.1, 5.2).

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

Parameters

NameTypeDescription
content*string | string[]

File content as string or list of lines

startLinenumber
Default:1

Starting line number (default: 1)

View source on GitHub