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

Method readFiles

lib/commands/help-search.js:34–41  ·  view source on GitHub ↗
(files)

Source from the content-addressed store, hash-verified

32 }
33
34 async readFiles (files) {
35 const res = {}
36 await Promise.all(files.map(async file => {
37 res[file] = (await readFile(file, 'utf8'))
38 .replace(/^---\n(.*\n)*?---\n/, '').trim()
39 }))
40 return res
41 }
42
43 async searchFiles (args, data) {
44 const results = []

Callers 1

execMethod · 0.95

Calls 2

readFileFunction · 0.85
replaceMethod · 0.80

Tested by

no test coverage detected