Package Exports
- appdirsjs
- appdirsjs/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (appdirsjs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
appdirsjs
A node.js library to get paths to directories to store configs, caches and data according to OS standarts.
Installation
npm install appdirsjsor
yarn install appdirsjsif you're using yarn.
Usage
import appDirs from "appdirsjs";
const dirs = appDirs({ appName: "expo" });
console.log(dirs.cache);
// /home/user/.cache/expo on Linux
// /Users/User/Library/Caches/expo on MacOS
// C:\Users\User\AppData\Local\Temp\expo on Windows
console.log(dirs.config);
// /home/user/.config/expo on Linux
// /Users/User/Library/Preferences/expo on MacOS
// C:\Users\User\AppData\Roaming\expo
console.log(dirs.data);
// /home/user/.local/share/expo on Linux
// /Users/User/Library/Application Support/expo on MacOS
// C:\Users\User\AppData\Local\expoKeep backward compability
Then switching from old-style dotfile directory,
such as ~/.myapp to new, like ~/.config/myapp,
you can pass legacyPath parameter
to keep using old directory if it exists:
import * as path from "path";
import appDirs from "appdirsjs";
const dirs = appDirs({
appName: "expo",
// Notice usage of full path
legacyPath: path.join(os.homedir(), ".expo"),
});
console.log(dirs.config);
// /home/user/.expoTODO
- Android support
- XDG on BSD support