mirror of
https://github.com/denoland/deno.git
synced 2024-11-26 16:09:27 -05:00
e435c2be15
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
28 lines
770 B
TypeScript
28 lines
770 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 await 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 await sendAsync("op_make_temp_file", options);
|
|
}
|