Skip to content

Latest commit

 

History

History
14 lines (9 loc) · 396 Bytes

File metadata and controls

14 lines (9 loc) · 396 Bytes

Methods

uniqueFilename(path, extension)

Generate a random file name within a given path and optional extension.

  • path - The file path within to generate a temporary file.
  • extension - File extension.
import { uniqueFilename } from '@hapi/file';

const fileName = uniqueFilename('/root', '.txt'); //results in 'C:\root\1580115599192-8540-61d96458412e09d9.txt'