MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / replaceInFile

Function replaceInFile

Bunoshfile.js:822–830  ·  view source on GitHub ↗
(file, fn)

Source from the content-addressed store, hash-verified

820
821
822function replaceInFile(file, fn) {
823 let text = fs.readFileSync(file).toString()
824 fn({
825 replace(pattern, replacement) {
826 text = text.replace(pattern, replacement)
827 },
828 })
829 fs.writeFileSync(file, text)
830}
831
832function ensureDir(dir) {
833 if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true })

Callers 8

docsPluginsFunction · 0.85
docsExternalHelpersFunction · 0.85
buildLibWithDocsFunction · 0.85
docsHelpersFunction · 0.85
docsPluginsFunction · 0.85
docsExternalHelpersFunction · 0.85
buildLibWithDocsFunction · 0.85
docsHelpersFunction · 0.85

Calls 2

fnFunction · 0.50
toStringMethod · 0.45

Tested by

no test coverage detected