Skip to main content

deno_desktop_dir

tag Build Status license

Returns the path to the user’s desktop directory.

The returned value depends on the operating system and is either a string, containing a value from the following table, or null.

Platform Value Example
Linux XDG_DESKTOP_DIR /home/justjavac/Desktop
macOS $HOME/Desktop /Users/justjavac/Desktop
Windows {FOLDERID_Desktop} C:\Users\justjavac\Desktop

Usage

Requires allow-env permission.

Returns null if there is no applicable directory or if any other error occurs.

import desktopDir from "https://deno.land/x/desktop_dir/mod.ts";

desktopDir();
// Lin: "/home/justjavac/Desktop"
// Mac: "/Users/justjavac/Desktop"
// Win: "C:\Users\justjavac\Desktop"

License

deno_desktop_dir is released under the MIT License. See the bundled LICENSE file for details.