MCPcopy Index your code
hub / github.com/nodejs/node / cleanupTmpFile

Function cleanupTmpFile

test/parallel/test-repl-programmatic-history-setup-history.js:177–186  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

175
176
177function cleanupTmpFile() {
178 try {
179 // Write over the file, clearing any history
180 fs.writeFileSync(defaultHistoryPath, '');
181 } catch (err) {
182 if (err.code === 'ENOENT') return true;
183 throw err;
184 }
185 return true;
186}
187
188// Copy our fixture to the tmp directory
189fs.createReadStream(historyFixturePath)

Callers 1

onCloseFunction · 0.70

Calls 1

writeFileSyncMethod · 0.45

Tested by

no test coverage detected