dijkstra-backend-cloudron/node_modules/xdg-basedir
rui hildt 4f5db9ab26 Add initial version of dijkstra backend cloudron image 2020-10-12 11:27:15 +02:00
..
index.js Add initial version of dijkstra backend cloudron image 2020-10-12 11:27:15 +02:00
license Add initial version of dijkstra backend cloudron image 2020-10-12 11:27:15 +02:00
package.json Add initial version of dijkstra backend cloudron image 2020-10-12 11:27:15 +02:00
readme.md Add initial version of dijkstra backend cloudron image 2020-10-12 11:27:15 +02:00

readme.md

xdg-basedir Build Status

Get XDG Base Directory paths

Install

$ npm install --save xdg-basedir

Usage

const xdgBasedir = require('xdg-basedir');

xdgBasedir.data;
//=> '/home/sindresorhus/.local/share'

xdgBasedir.config;
//=> '/home/sindresorhus/.config'

xdgBasedir.dataDirs
//=> ['/home/sindresorhus/.local/share', '/usr/local/share/', '/usr/share/']

API

The properties .data, .config, .cache, .runtime will return null in the uncommon case that both the XDG environment variable is not set and the users home directory can't be found. You need to handle this case. A common solution is to fall back to a temp directory.

.data

Directory for user specific data files.

.config

Directory for user specific configuration files.

.cache

Directory for user specific non-essential data files.

.runtime

Directory for user-specific non-essential runtime files and other file objects (such as sockets, named pipes, etc).

.dataDirs

Preference-ordered array of base directories to search for data files in addition to .data.

.configDirs

Preference-ordered array of base directories to search for configuration files in addition to .config.

License

MIT © Sindre Sorhus