iceshrimp/packages/backend/src/misc/create-temp.ts
syuilo 14148f6c4a refactoring
Resolve #7779
2021-11-12 02:02:25 +09:00

11 lines
237 B
TypeScript

import * as tmp from 'tmp';
export function createTemp(): Promise<[string, any]> {
return new Promise<[string, any]>((res, rej) => {
tmp.file((e, path, fd, cleanup) => {
if (e) return rej(e);
res([path, cleanup]);
});
});
}