1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-12-28 13:38:08 +09:00
hotomoe/src/misc/create-temp.ts
MeiMei 7bebea087c Fix #4546 (#4548)
* Refactor download

* emoji type
2019-03-21 04:50:44 +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]);
});
});
}