This is a straight port of Sindre Sorhus' env-paths node library. Use it to correct OS-specific paths for storing things like data, config, cache etc.
To use this library, you need to run deno with the --allow-env
permission.
import { envPaths } from "./mod.ts"; // TODO: add deno.land url once there
const paths = envPaths("MyApp");
paths.data;
//=> '/Users/uku.tammet/Library/Application Support/MyApp-deno'
paths.config;
//=> '/Users/uku.tammet/Library/Preferences/MyApp-deno'
Note: It only generates the path strings. It doesn't create the directories for you.
Type: string
Name of your project. Used to generate the paths.
Type: object
Type: string
Default: 'deno'
Don't use this option unless you really have to!
Suffix appended to the project name to avoid name conflicts with native
apps. Pass an empty string to disable it.
Directory for data files.
Directory for config files.
Directory for non-essential data files.
Directory for log files.
Directory for temporary files.
MIT licensed under Sindre Sorhus, as this is a straight port (basically copy) of their work.