In v1.1.2(2020.06.26), Deno Remove
Deno.dirand dirs dependency #6385
Returns the path to the user's executable 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_BIN_HOME or $XDG_DATA_HOME/../bin or $HOME/.local/bin |
/home/justjavac/.local/bin |
| macOS | - | - |
| Windows | - | - |
Requires allow-env permission.
Returns null if there is no applicable directory or if any other error occurs.
import executableDir from "https://deno.land/x/executable_dir/mod.ts";
executableDir();
// Lin: "/home/justjavac/.local/bin"
// Mac: null
// Win: nulldeno_executable_dir is released under the MIT License. See the bundled LICENSE file for details.