appdirsjs
A node.js library to get paths to directories to store configs, caches and data according to OS standarts.
Installation
npm install appdirsjs
or
yarn install appdirsjs
if you're using yarn.
Usage
import appDirs from "appdirsjs";
const dirs = appDirs({ appName: "expo" });
console.log(dirs.cache);
console.log(dirs.config);
console.log(dirs.data);
Keep 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",
legacyPath: path.join(os.homedir(), ".expo"),
});
console.log(dirs.config);
TODO