MCPcopy
hub / github.com/vitejs/vite / editFile

Function editFile

packages/create-vite/src/index.ts:1042–1045  ·  view source on GitHub ↗
(file: string, callback: (content: string) => string)

Source from the content-addressed store, hash-verified

1040}
1041
1042function editFile(file: string, callback: (content: string) => string) {
1043 const content = fs.readFileSync(file, 'utf-8')
1044 fs.writeFileSync(file, callback(content), 'utf-8')
1045}
1046
1047function getFullCustomCommand(customCommand: string, pkgInfo?: PkgInfo) {
1048 const pkgManager = pkgInfo ? pkgInfo.name : 'npm'

Callers 3

setupReactCompilerFunction · 0.70
setupEslintFunction · 0.70

Calls 1

callbackFunction · 0.85

Tested by

no test coverage detected