0.1.1 • Published 2 years ago

userdata-path v0.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

userdata-path

Get the path of userData folder in system (This library is only available in the Node.js environment).

Usage

Step 1: Use npm or other package manager to install this package.

$ npm install userdata-path

Step 2: Import and use it.

import userDataPath, { resolve } from 'userdata-path';

const configData = resolve('config');

console.log(userDataPath);
// Library/Preferences for macOS
// AppData/Roaming or specific path in environment paths for Windows
// .local/share or /usr/local/share or specific path in environment paths for Linux

console.log(configData);
// if not exist, resolve method will create it.
// equal to path.resolve(userDataPath, 'config');

License

MIT