https://github.com/justjavac/deno_download_dir
Returns the path to the user's download directory.
https://github.com/justjavac/deno_download_dir
deno deno-module dir download path
Last synced: 2 months ago
JSON representation
Returns the path to the user's download directory.
- Host: GitHub
- URL: https://github.com/justjavac/deno_download_dir
- Owner: justjavac
- License: mit
- Created: 2020-08-19T14:52:37.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-19T14:57:57.000Z (almost 6 years ago)
- Last Synced: 2025-06-02T16:31:23.162Z (about 1 year ago)
- Topics: deno, deno-module, dir, download, path
- Language: TypeScript
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# deno_download_dir
[](https://github.com/justjavac/deno_download_dir/releases)
[](https://github.com/justjavac/deno_download_dir/actions)
[](https://github.com/justjavac/deno_download_dir/blob/master/LICENSE)
[](https://github.com/denoland/deno)
Returns the path to the user's download 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_DOWNLOAD_DIR` | /home/justjavac/Downloads |
| macOS | `$HOME`/Downloads | /Users/justjavac/Downloads |
| Windows | `{FOLDERID_Downloads}` | C:\Users\justjavac\Downloads |
## Usage
Requires `allow-env` permission.
Returns `null` if there is no applicable directory or if any other error occurs.
```ts
import downloadDir from "https://deno.land/x/download_dir/mod.ts";
downloadDir();
// Lin: "/home/justjavac/Downloads"
// Mac: "/Users/justjavac/Downloads"
// Win: "C:\Users\justjavac\Downloads"
```
## License
[deno_download_dir](https://github.com/justjavac/deno_download_dir) is released under the MIT License. See the bundled [LICENSE](./LICENSE) file for details.