https://github.com/justjavac/deno_desktop_dir
Returns the path to the user's desktop directory.
https://github.com/justjavac/deno_desktop_dir
deno deno-module directory path
Last synced: about 2 months ago
JSON representation
Returns the path to the user's desktop directory.
- Host: GitHub
- URL: https://github.com/justjavac/deno_desktop_dir
- Owner: justjavac
- License: mit
- Created: 2020-08-19T14:29:39.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-19T14:40:06.000Z (almost 6 years ago)
- Last Synced: 2026-04-24T00:23:38.541Z (2 months ago)
- Topics: deno, deno-module, directory, path
- Language: TypeScript
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# deno_desktop_dir
[](https://github.com/justjavac/deno_desktop_dir/releases)
[](https://github.com/justjavac/deno_desktop_dir/actions)
[](https://github.com/justjavac/deno_desktop_dir/blob/master/LICENSE)
[](https://github.com/denoland/deno)
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.
```ts
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](https://github.com/justjavac/deno_desktop_dir) is released under the MIT License. See the bundled [LICENSE](./LICENSE) file for details.