.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / xdg-basedir / readme.md
1 # xdg-basedir [![Build Status](https://travis-ci.org/sindresorhus/xdg-basedir.svg?branch=master)](https://travis-ci.org/sindresorhus/xdg-basedir)
2
3 > Get [XDG Base Directory](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) paths
4
5
6 ## Install
7
8 ```
9 $ npm install --save xdg-basedir
10 ```
11
12
13 ## Usage
14
15 ```js
16 const xdgBasedir = require('xdg-basedir');
17
18 xdgBasedir.data;
19 //=> '/home/sindresorhus/.local/share'
20
21 xdgBasedir.config;
22 //=> '/home/sindresorhus/.config'
23
24 xdgBasedir.dataDirs
25 //=> ['/home/sindresorhus/.local/share', '/usr/local/share/', '/usr/share/']
26 ```
27
28
29 ## API
30
31 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](https://github.com/yeoman/configstore/blob/b82690fc401318ad18dcd7d151a0003a4898a314/index.js#L15).
32
33 ### .data
34
35 Directory for user specific data files.
36
37 ### .config
38
39 Directory for user specific configuration files.
40
41 ### .cache
42
43 Directory for user specific non-essential data files.
44
45 ### .runtime
46
47 Directory for user-specific non-essential runtime files and other file objects (such as sockets, named pipes, etc).
48
49 ### .dataDirs
50
51 Preference-ordered array of base directories to search for data files in addition to `.data`.
52
53 ### .configDirs
54
55 Preference-ordered array of base directories to search for configuration files in addition to `.config`.
56
57
58 ## License
59
60 MIT © [Sindre Sorhus](https://sindresorhus.com)