MCPcopy Create free account
hub / github.com/npm/cli / readFile

Function readFile

smoke-tests/test/fixtures/setup.js:248–251  ·  view source on GitHub ↗
(f)

Source from the content-addressed store, hash-verified

246
247 // helpers for reading/writing files and their source
248 const readFile = async (f) => {
249 const file = await fs.readFile(join(paths.project, f), 'utf-8')
250 return extname(f) === '.json' ? JSON.parse(file) : file
251 }
252
253 return {
254 npmPath,

Callers 15

index.jsFile · 0.85
proxy.jsFile · 0.85
readJsonFunction · 0.85
listMethod · 0.85
listWorkspacesMethod · 0.85
editMethod · 0.85
readFilesMethod · 0.85
loadFilesMethod · 0.85
prune-versions.jsFile · 0.85
read-json.jsFile · 0.85
write-json.jsFile · 0.85

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected