Skip to content

a library that provides config/cache/data paths, following the respective conventions on Linux, macOS and Windows.

License

Notifications You must be signed in to change notification settings

jsaavedrazuniga/directories-deno

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

directories

This library is based on Rust's crate directories

Usage

below is an example with user alice:

import {
  baseDirs,
  projectDirs,
  userDirs,
} from "https://deno.land/x/directories/mod.ts";

const base = baseDirs.setup();
console.log(base.cacheDir);
// Linux: /home/alice/.cache
// Windows: C:\Users\Alice\AppData\Local
// macOS: /Users/Alice/Library/Caches

const user = userDirs.setup();
console.log(user.musicDir);
// Linux: /home/alice/Music
// Windows: C:\Users\Alice\Muic
// macOS: /Users/Alice/Music

const project = projectDirs.setup("com", "jheysondev", "directories");
console.log(project.preferenceDir);
// Linux: /home/alice/.config/directories
// Windows: C:\Users\Alice\AppData\Roaming\jheysondev\directories
// macOS: /Users/Alice/Library/Preferences/com.jheysondev.directories

About

a library that provides config/cache/data paths, following the respective conventions on Linux, macOS and Windows.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published