import { promisify } from 'util'; import fs from 'fs'; import path from 'path'; import os from 'os'; export const getLocalDirectory = (): string => os.tmpdir(); export const deleteFile = (filePath: string): Promise => promisify(fs.unlink)(filePath); export const getFilename = (filePath: string): string => path.parse(path.basename(filePath)).base; export const getLocalFilePath = (filename: string): string => path.join(getLocalDirectory(), filename);