Skip to content

Returns the path to the user's config directory.

License

Notifications You must be signed in to change notification settings

justjavac/deno_config_dir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deno_config_dir

tag Build Status license

Returns the path to the user's config 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_CONFIG_HOME or $HOME/.config /home/justjavac/.config
macOS $HOME/Library/Preferences /Users/justjavac/Library/Preferences
Windows {FOLDERID_RoamingAppData} C:\Users\justjavac\AppData\Roaming

Usage

Requires allow-env permission.

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

import configDir from "https://deno.land/x/config_dir/mod.ts";

configDir();
// Lin: "/home/justjavac/.config"
// Mac: "/Users/justjavac/Library/Preferences"
// Win: "C:\Users\justjavac\AppData\Roaming"

License

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