MCPcopy
hub / github.com/fastify/fastify / createTempFile

Function createTempFile

test/logger/logger-test-utils.js:18–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16
17let count = 0
18function createTempFile () {
19 const file = path.join(os.tmpdir(), `sonic-boom-${process.pid}-${count++}`)
20 function cleanup () {
21 try {
22 fs.unlinkSync(file)
23 } catch { }
24 }
25 return { file, cleanup }
26}
27
28function request (url, cleanup = () => { }) {
29 const promise = createDeferredPromise()

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected