1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-28 18:19:08 -05:00
denoland-deno/cli/js/ops/fs/make_temp.ts
2020-03-16 10:22:16 +01:00

28 lines
758 B
TypeScript

// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import { sendSync, sendAsync } from "../dispatch_json.ts";
export interface MakeTempOptions {
dir?: string;
prefix?: string;
suffix?: string;
}
export function makeTempDirSync(options: MakeTempOptions = {}): string {
return sendSync("op_make_temp_dir", options);
}
export async function makeTempDir(
options: MakeTempOptions = {}
): Promise<string> {
return sendAsync("op_make_temp_dir", options);
}
export function makeTempFileSync(options: MakeTempOptions = {}): string {
return sendSync("op_make_temp_file", options);
}
export async function makeTempFile(
options: MakeTempOptions = {}
): Promise<string> {
return sendAsync("op_make_temp_file", options);
}