MCPcopy
hub / github.com/SukkaW/Surge / readFileByLine

Function readFileByLine

Build/lib/fetch-text-by-line.ts:13–18  ·  view source on GitHub ↗
(file: string)

Source from the content-addressed store, hash-verified

11import { invariant } from 'foxts/guard';
12
13export function readFileByLine(file: string): AsyncIterable<string> {
14 return readline.createInterface({
15 input: fs.createReadStream(file/* , { encoding: 'utf-8' } */),
16 crlfDelay: Infinity
17 });
18}
19
20export const createReadlineInterfaceFromResponse: ((resp: UndiciResponseData | UnidiciWebResponse, processLine?: boolean) => ReadableStream<string>) = (resp, processLine = false) => {
21 invariant(resp.body, 'Failed to fetch remote text');

Callers 7

processFileFunction · 0.90
trimFileLinesFunction · 0.90
dedupeFileFunction · 0.90
compareAndWriteFileFunction · 0.90
runAgainstSourceFileFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected