Skip to content

Returns the path to the user's download directory.

License

Notifications You must be signed in to change notification settings

justjavac/deno_download_dir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deno_download_dir

tag Build Status license

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.

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 is released under the MIT License. See the bundled LICENSE file for details.