MCPcopy Create free account
hub / github.com/Snapchat/Valdi / readInitialContent

Function readInitialContent

npm_modules/cli/src/commands/log.ts:15–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13 const abortController = new AbortController();
14
15 const readInitialContent = () => {
16 const fileStream = fs.createReadStream(filePath, { encoding: 'utf8', start: 0 });
17
18 fileStream.on('data', chunk => {
19 process.stdout.write(chunk);
20 });
21
22 fileStream.on('end', () => {
23 fileSize = fs.statSync(filePath).size;
24
25 if (!isWatching) {
26 startWatching();
27 }
28 });
29 };
30
31 const startWatching = () => {
32 isWatching = true;

Callers 2

startWatchingFunction · 0.85
readAndWatchFileFunction · 0.85

Calls 3

startWatchingFunction · 0.85
onMethod · 0.65
writeMethod · 0.65

Tested by

no test coverage detected