Searches for content within a single file
Path to the file to search
String or regex pattern to search for
Search options
OperationResult containing array of SearchMatch objects
const result = await searchInFile('/path/to/file.txt', 'function', { includeLineNumbers: true, contextLines: 2});if (result.success) { result.data.forEach(match => { console.log(`Found at line ${match.lineNumber}: ${match.line}`); });} Copy
const result = await searchInFile('/path/to/file.txt', 'function', { includeLineNumbers: true, contextLines: 2});if (result.success) { result.data.forEach(match => { console.log(`Found at line ${match.lineNumber}: ${match.line}`); });}
Searches for content within a single file