Skip to content

Returns the path to the user's font directory.

License

Notifications You must be signed in to change notification settings

justjavac/deno_font_dir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deno_font_dir

tag Build Status license

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: null

License

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