MCPcopy Create free account
hub / github.com/cloudflare/templates / hashFile

Function hashFile

cli/src/npm.ts:164–174  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

162});
163
164async function hashFile(filePath: string): Promise<string> {
165 const hash = createHash("sha1");
166
167 const stream = fs.createReadStream(filePath);
168
169 for await (const chunk of stream) {
170 hash.update(chunk as Buffer);
171 }
172
173 return hash.digest("hex");
174}

Callers 2

generateNpmLockfilesFunction · 0.85
lintNpmLockfilesFunction · 0.85

Calls 1

updateMethod · 0.65

Tested by

no test coverage detected