Repository
Current version released
5 years ago
Versions
deno_font_dir
Returns the path to the user’s font 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_DATA_HOME/fonts or $HOME/.local/share/fonts |
/home/justjavac/.local/share/fonts |
| macOS | $HOME/Library/Fonts |
/Users/justjavac/Library/Fonts |
| Windows | – | – |
Usage
Requires allow-env permission.
Returns null if there is no applicable directory or if any other error occurs.
import fontDir from "https://deno.land/x/font_dir/mod.ts";
fontDir();
// Lin: "/home/justjavac/.local/share/fonts"
// Mac: "/Users/justjavac/Library/Fonts"
// Win: nullLicense
deno_font_dir is released under the MIT License. See the bundled LICENSE file for details.