Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/lib.deno.d.ts>Deno.makeTempFileSync

A JavaScript extension package for building strong and modern applications.
Latest
function Deno.makeTempFileSync
allow-write
import { Deno } from "https://deno.land/x/ayonli_jsext@v0.9.72/lib.deno.d.ts";
const { makeTempFileSync } = Deno;

Synchronously creates a new temporary file in the default directory for temporary files, unless dir is specified.

Other options include prefixing and suffixing the directory name with prefix and suffix respectively.

The full path to the newly created file is returned.

Multiple programs calling this function simultaneously will create different files. It is the caller's responsibility to remove the file when no longer needed.

const tempFileName0 = Deno.makeTempFileSync(); // e.g. /tmp/419e0bf2
const tempFileName1 = Deno.makeTempFileSync({ prefix: 'my_temp' });  // e.g. /tmp/my_temp754d3098

Requires allow-write permission.

Parameters

optional
options: MakeTempOptions

Returns

string