1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-12-29 05:58:06 +09:00
hotomoe/src/misc/create-temp.ts

11 lines
237 B
TypeScript
Raw Normal View History

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]);
});
});
}