10
src/misc/create-temp.ts
Normal file
10
src/misc/create-temp.ts
Normal file
@ -0,0 +1,10 @@
|
||||
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]);
|
||||
});
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user