({ extension }: { extension?: string } = {})
| 8 | const tempDir = os.tmpdir() |
| 9 | |
| 10 | export 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 | |
| 16 | export function temporaryDirectory({ prefix = '' } = {}): string { |
| 17 | const directory = fs.mkdtempSync(`${tempDir}${path.sep}${prefix}`) |
no test coverage detected