MCPcopy Create free account
hub / github.com/netlify/cli / temporaryFile

Function temporaryFile

src/utils/temporary-file.ts:10–14  ·  view source on GitHub ↗
({ extension }: { extension?: string } = {})

Source from the content-addressed store, hash-verified

8const tempDir = os.tmpdir()
9
10export function temporaryFile({ extension }: { extension?: string } = {}): string {
11 const baseName = uniqueString()
12 const ext = extension ? '.' + extension.replace(/^\./, '') : ''
13 return path.join(tempDir, baseName + ext)
14}
15
16export function temporaryDirectory({ prefix = '' } = {}): string {
17 const directory = fs.mkdtempSync(`${tempDir}${path.sep}${prefix}`)

Callers 2

getBuildFunctionFunction · 0.85
createMockFunction · 0.85

Calls 1

uniqueStringFunction · 0.85

Tested by

no test coverage detected