This commit is contained in:
2024-03-22 03:47:51 +05:30
parent 8bcf3d211e
commit 89819f6fe2
28440 changed files with 3211033 additions and 2 deletions

90
node_modules/xdg-basedir/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,90 @@
/**
Directory for user-specific data files.
@example
```
import {xdgData} from 'xdg-basedir';
console.log(xdgData);
//=> '/home/sindresorhus/.local/share'
```
*/
export const xdgData: string | undefined;
/**
Directory for user-specific configuration files.
@example
```
import {xdgConfig} from 'xdg-basedir';
console.log(xdgConfig);
//=> '/home/sindresorhus/.config'
```
*/
export const xdgConfig: string | undefined;
/**
Directory for user-specific state files.
@example
```
import {xdgState} from 'xdg-basedir';
console.log(xdgState);
//=> '/home/sindresorhus/.local/state'
```
*/
export const xdgState: string | undefined;
/**
Directory for user-specific non-essential data files.
@example
```
import {xdgCache} from 'xdg-basedir';
console.log(xdgCache);
//=> '/home/sindresorhus/.cache'
```
*/
export const xdgCache: string | undefined;
/**
Directory for user-specific non-essential runtime files and other file objects (such as sockets, named pipes, etc).
@example
```
import {xdgRuntime} from 'xdg-basedir';
console.log(xdgRuntime);
//=> '/run/user/sindresorhus'
```
*/
export const xdgRuntime: string | undefined;
/**
Preference-ordered array of base directories to search for data files in addition to `xdgData`.
@example
```
import {xdgDataDirectories} from 'xdg-basedir';
console.log(xdgDataDirectories);
//=> ['/home/sindresorhus/.local/share', '/usr/local/share/', '/usr/share/']
```
*/
export const xdgDataDirectories: readonly string[];
/**
Preference-ordered array of base directories to search for configuration files in addition to `xdgConfig`.
@example
```
import {xdgConfigDirectories} from 'xdg-basedir';
console.log(xdgConfigDirectories);
//=> ['/home/sindresorhus/.config', '/etc/xdg']
```
*/
export const xdgConfigDirectories: readonly string[];

30
node_modules/xdg-basedir/index.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
import os from 'os';
import path from 'path';
const homeDirectory = os.homedir();
const {env} = process;
export const xdgData = env.XDG_DATA_HOME ||
(homeDirectory ? path.join(homeDirectory, '.local', 'share') : undefined);
export const xdgConfig = env.XDG_CONFIG_HOME ||
(homeDirectory ? path.join(homeDirectory, '.config') : undefined);
export const xdgState = env.XDG_STATE_HOME ||
(homeDirectory ? path.join(homeDirectory, '.local', 'state') : undefined);
export const xdgCache = env.XDG_CACHE_HOME || (homeDirectory ? path.join(homeDirectory, '.cache') : undefined);
export const xdgRuntime = env.XDG_RUNTIME_DIR || undefined;
export const xdgDataDirectories = (env.XDG_DATA_DIRS || '/usr/local/share/:/usr/share/').split(':');
if (xdgData) {
xdgDataDirectories.unshift(xdgData);
}
export const xdgConfigDirectories = (env.XDG_CONFIG_DIRS || '/etc/xdg').split(':');
if (xdgConfig) {
xdgConfigDirectories.unshift(xdgConfig);
}

9
node_modules/xdg-basedir/license generated vendored Normal file
View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://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.

47
node_modules/xdg-basedir/package.json generated vendored Normal file
View File

@@ -0,0 +1,47 @@
{
"name": "xdg-basedir",
"version": "5.1.0",
"description": "Get XDG Base Directory paths",
"license": "MIT",
"repository": "sindresorhus/xdg-basedir",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"engines": {
"node": ">=12"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"xdg",
"base",
"directory",
"basedir",
"path",
"data",
"config",
"cache",
"linux",
"unix",
"spec"
],
"devDependencies": {
"ava": "^1.4.1",
"import-fresh": "^3.0.0",
"tsd": "^0.7.2",
"xo": "^0.24.0"
},
"ava": {
"serial": true
}
}

70
node_modules/xdg-basedir/readme.md generated vendored Normal file
View File

@@ -0,0 +1,70 @@
# xdg-basedir
> Get [XDG Base Directory](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) paths
This package is meant for Linux. You should not use XDG on macOS or Windows. Instead, you should follow their platform conventions. You can use [`env-paths`](https://github.com/sindresorhus/env-paths) for that.
## Install
```
$ npm install xdg-basedir
```
## Usage
```js
import {xdgData, xdgConfig, xdgDataDirectories} from 'xdg-basedir';
console.log(xdgData);
//=> '/home/sindresorhus/.local/share'
console.log(xdgConfig);
//=> '/home/sindresorhus/.config'
console.log(xdgDataDirectories);
//=> ['/home/sindresorhus/.local/share', '/usr/local/share/', '/usr/share/']
```
## API
The exports `xdgData`, `xdgConfig`, `xdgCache`, `xdgRuntime` will return `undefined` 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 temporary directory](https://github.com/yeoman/configstore/blob/b82690fc401318ad18dcd7d151a0003a4898a314/index.js#L15).
### xdgData
Directory for user-specific data files.
### xdgConfig
Directory for user-specific configuration files.
### xdgState
Directory for user-specific state files.
### xdgCache
Directory for user-specific non-essential data files.
### xdgRuntime
Directory for user-specific non-essential runtime files and other file objects (such as sockets, named pipes, etc).
### xdgDataDirectories
Preference-ordered array of base directories to search for data files in addition to `xdgData`.
### xdgConfigDirectories
Preference-ordered array of base directories to search for configuration files in addition to `xdgConfig`.
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-xdg-basedir?utm_source=npm-xdg-basedir&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>