parent
037837b551
commit
0e4a111f81
1714 changed files with 20803 additions and 11751 deletions
10
packages/backend/src/misc/create-temp.ts
Normal file
10
packages/backend/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]);
|
||||
});
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue