aboutsummaryrefslogtreecommitdiff
path: root/node_modules/xdg-basedir
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/xdg-basedir')
-rw-r--r--node_modules/xdg-basedir/index.js28
-rw-r--r--node_modules/xdg-basedir/license21
-rw-r--r--node_modules/xdg-basedir/package.json40
-rw-r--r--node_modules/xdg-basedir/readme.md60
4 files changed, 149 insertions, 0 deletions
diff --git a/node_modules/xdg-basedir/index.js b/node_modules/xdg-basedir/index.js
new file mode 100644
index 0000000..f5aa176
--- /dev/null
+++ b/node_modules/xdg-basedir/index.js
@@ -0,0 +1,28 @@
+'use strict';
+const os = require('os');
+const path = require('path');
+
+const home = os.homedir();
+const env = process.env;
+
+exports.data = env.XDG_DATA_HOME ||
+ (home ? path.join(home, '.local', 'share') : null);
+
+exports.config = env.XDG_CONFIG_HOME ||
+ (home ? path.join(home, '.config') : null);
+
+exports.cache = env.XDG_CACHE_HOME || (home ? path.join(home, '.cache') : null);
+
+exports.runtime = env.XDG_RUNTIME_DIR || null;
+
+exports.dataDirs = (env.XDG_DATA_DIRS || '/usr/local/share/:/usr/share/').split(':');
+
+if (exports.data) {
+ exports.dataDirs.unshift(exports.data);
+}
+
+exports.configDirs = (env.XDG_CONFIG_DIRS || '/etc/xdg').split(':');
+
+if (exports.config) {
+ exports.configDirs.unshift(exports.config);
+}
diff --git a/node_modules/xdg-basedir/license b/node_modules/xdg-basedir/license
new file mode 100644
index 0000000..654d0bf
--- /dev/null
+++ b/node_modules/xdg-basedir/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/xdg-basedir/package.json b/node_modules/xdg-basedir/package.json
new file mode 100644
index 0000000..08bfa8c
--- /dev/null
+++ b/node_modules/xdg-basedir/package.json
@@ -0,0 +1,40 @@
+{
+ "name": "xdg-basedir",
+ "version": "3.0.0",
+ "description": "Get XDG Base Directory paths",
+ "license": "MIT",
+ "repository": "sindresorhus/xdg-basedir",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "xdg",
+ "base",
+ "directory",
+ "dir",
+ "basedir",
+ "path",
+ "data",
+ "config",
+ "cache",
+ "linux",
+ "unix",
+ "spec"
+ ],
+ "devDependencies": {
+ "ava": "*",
+ "require-uncached": "^1.0.2",
+ "xo": "*"
+ }
+}
diff --git a/node_modules/xdg-basedir/readme.md b/node_modules/xdg-basedir/readme.md
new file mode 100644
index 0000000..61f8c16
--- /dev/null
+++ b/node_modules/xdg-basedir/readme.md
@@ -0,0 +1,60 @@
+# xdg-basedir [![Build Status](https://travis-ci.org/sindresorhus/xdg-basedir.svg?branch=master)](https://travis-ci.org/sindresorhus/xdg-basedir)
+
+> Get [XDG Base Directory](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) paths
+
+
+## Install
+
+```
+$ npm install --save xdg-basedir
+```
+
+
+## Usage
+
+```js
+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](https://github.com/yeoman/configstore/blob/b82690fc401318ad18dcd7d151a0003a4898a314/index.js#L15).
+
+### .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](https://sindresorhus.com)