tmpPath
Less than 1 minute
function tmpPath(): Promise<string>Asynchronously retrieves the real path of the system's temporary directory.
- On linux, the path will be
/tmp - On macOS, the path will be
/var/folders/jf/f2twvvvs5jl_m49tf034ffpw0000gn - On Windows, the path will be
%LOCALAPPDATA%\Temp
Returns
Promise<string>
A promise that resolves to the real path of the temporary directory.
Example
// Get the real path of the system's temporary directory
const path = await tmpPath();
console.log('Temporary directory path:', path);