MCPcopy Index your code
hub / github.com/cameri/nostream / createTempFile

Function createTempFile

test/unit/utils/compression.spec.ts:55–63  ·  view source on GitHub ↗
(name: string, data: Buffer)

Source from the content-addressed store, hash-verified

53 const tempDirs: string[] = []
54
55 const createTempFile = (name: string, data: Buffer): string => {
56 const tmpDir = fs.mkdtempSync(join(os.tmpdir(), 'nostream-compression-'))
57 tempDirs.push(tmpDir)
58
59 const filePath = join(tmpDir, name)
60 fs.writeFileSync(filePath, data)
61
62 return filePath
63 }
64
65 afterEach(() => {
66 for (const tmpDir of tempDirs.splice(0)) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected