Update app and tooling

This commit is contained in:
Lawrence Chen 2026-01-29 17:36:26 -08:00
parent 3046531bdd
commit e620ec7349
4950 changed files with 2975120 additions and 10 deletions

243
node_modules/xdg-portable/CHANGELOG.mkd generated vendored Normal file
View file

@ -0,0 +1,243 @@
<!-- markdownlint-disable heading-increment no-duplicate-heading no-inline-html -->
<!-- spellchecker:ignore () AppVeyor CICD Deno EditorConfig Veyor chglog deps gitattributes maint markdownlint prettierignore repo tmpdir typeof -->
<!-- spellchecker:ignore (names) ChocolateBoy rivy -->
<!-- specific mis-spelled commits--><!-- spell-checker:ignoreRegexp ^.*/cfb3467c82.*$ -->
# CHANGELOG <br/> [xdg-portable](https://github.com/rivy/js.xdg-portable)
---
## [v7.3.0](https://github.com/rivy/js.xdg-portable/compare/v7.2.2...v7.3.0) <small>(2020-12-15)</small>
#### Fixes
* fix ~ remove erroneous devDependency ('fs[@0](https://github.com/0).0.1-security') &ac; [`de6b7e8`](https://github.com/rivy/js.xdg-portable/commit/de6b7e84d9134403dd88e803b074e5f5ff86ceb7)
* fix test type declarations for `configDirs()` and `dataDirs()` &ac; [`35c5691`](https://github.com/rivy/js.xdg-portable/commit/35c5691b07bfaa2187723d0b027983746ed0daee)
#### Documentation
* docs ~ add CHANGELOG spell-checker exceptions &ac; [`e4a51e3`](https://github.com/rivy/js.xdg-portable/commit/e4a51e37fde25fc293604f09f0ff974c174b6691)
* docs ~ README polish &ac; [`c017d0b`](https://github.com/rivy/js.xdg-portable/commit/c017d0bde7086848e9facb45ad38d975ee5794c6)
* docs ~ correct spell-check errors &ac; [`37a31bd`](https://github.com/rivy/js.xdg-portable/commit/37a31bd29580d6fad67d70e483a532b419a52a42)
* docs ~ simplify examples (removing extra developer deps) &ac; [`3000c70`](https://github.com/rivy/js.xdg-portable/commit/3000c70b3b70223eeea6c25a5f0ad7ea7ac43763)
#### Maintenance
* maint ~ reconfigure for `git-changelog` (from GH:rivy-go) &ac; [`d3bd66d`](https://github.com/rivy/js.xdg-portable/commit/d3bd66d8f8cdf35f7ff10e94bba1d5476b917274)
* maint/**CICD**: add GitHub Actions (GHA) CI &ac; [`a292f58`](https://github.com/rivy/js.xdg-portable/commit/a292f58184fb2a73366dad14ac37ad8f1c5837f0)
* maint/**build**: add CHANGELOG.mkd to distribution file list &ac; [`f187500`](https://github.com/rivy/js.xdg-portable/commit/f187500f098d6a877122697a4dc3424211e305b1)
* maint/**build**: update CHANGELOG template with markdown-lint and spell-checker signals &ac; [`cfa2185`](https://github.com/rivy/js.xdg-portable/commit/cfa21854c344f2622c44a9c2cab595007204ff6b)
* maint/**build**: polish package.json formatting &ac; [`e81e8f3`](https://github.com/rivy/js.xdg-portable/commit/e81e8f3e220f3adc0ec56eeb5532212241d5372c)
* maint/**build**: reorganize 'package.json' &ac; [`ff7988a`](https://github.com/rivy/js.xdg-portable/commit/ff7988a805fdb94703b972ba9855b958828af1b1)
* maint/**build**: refine package manifest &ac; [`f5acb16`](https://github.com/rivy/js.xdg-portable/commit/f5acb16743fee411991686a6b6a51e0cba031495)
* maint/**build**: revise and polish npm scripts &ac; [`c6ed305`](https://github.com/rivy/js.xdg-portable/commit/c6ed3058200120a218cb8515005807cfb28066e4)
* maint/**build**: add explanation for NPMrc `package-lock=false` &ac; [`570f464`](https://github.com/rivy/js.xdg-portable/commit/570f4649604751ffbbe1037f41ad904534cb0a4e)
* maint/**build**: update EditorConfig (include more file types and commentary) &ac; [`6428093`](https://github.com/rivy/js.xdg-portable/commit/6428093b199034d3c10ebf123ddd8c68e55a83be)
* maint/**build**: expand/polish `npm run ...` scripts (with dep updates) &ac; [`26f6c52`](https://github.com/rivy/js.xdg-portable/commit/26f6c52e4b073dd332897a5d03cc0cff51dc0316)
* maint/**build**: fix `tsd` complaint (types specification missing from package "files" list) &ac; [`5570547`](https://github.com/rivy/js.xdg-portable/commit/55705473c69c29569dfba5dafd3cf7469bca5f9d)
* maint/**build**: fix package keywords &ac; [`446854f`](https://github.com/rivy/js.xdg-portable/commit/446854f1f7063ddb39e35740a0f0349d3dee16a7)
* maint/**dev**: update 'eslintrc.js' configuration file &ac; [`601de10`](https://github.com/rivy/js.xdg-portable/commit/601de1037886c6d33dee7a186a583415b87bc5b9)
* maint/**dev**: remove XO (`xo`) &ac; [`4d47f8a`](https://github.com/rivy/js.xdg-portable/commit/4d47f8a0e30fc3491c28185b2bb9b3451d576da5)
* maint/**dev**: revise gitignore files to include build artifacts &ac; [`8f9a93e`](https://github.com/rivy/js.xdg-portable/commit/8f9a93ee4bdeeb322de4bb9ad474fbb9a152cb26)
* maint/**dev**: revise gitattributes &ac; [`a291753`](https://github.com/rivy/js.xdg-portable/commit/a2917534a2d4e13aca12c63010dfdc7f38fe6ae1)
* maint/**dev**: fix ESLint configuration file format (JSON => JS) &ac; [`b06aa7c`](https://github.com/rivy/js.xdg-portable/commit/b06aa7c7c77012ab38c4856c821c0d238ad3b05b)
* maint/**dev**: add Prettier (`prettier`) &ac; [`506493b`](https://github.com/rivy/js.xdg-portable/commit/506493bc2f50b16bcdfeae44d346b8bfdd8437db)
* maint/**dev**: add Prettier configuration &ac; [`70b003b`](https://github.com/rivy/js.xdg-portable/commit/70b003b25540a525b7a189394bbd0f54a015f08d)
* maint/**dev**: add Prettier ignore file (to simplify automation) &ac; [`1c13258`](https://github.com/rivy/js.xdg-portable/commit/1c13258aa49f30684b67e5e0e6790a9e394da895)
* maint/**dev**: add notation about `ava` and `nyc` version restrictions with NodeJS-v6 &ac; [`18567d0`](https://github.com/rivy/js.xdg-portable/commit/18567d0062a9256cc8016ad883d06d2aa5120809)
* maint/**dev**: add VSCode settings (ENABLE auto-format on save) &ac; [`1b42a25`](https://github.com/rivy/js.xdg-portable/commit/1b42a25f25138e310e1651ffec0ec0bb5b0e93c3)
* maint/**dev**: add .history (for VSCode plugin) to .gitignore &ac; [`65b33ee`](https://github.com/rivy/js.xdg-portable/commit/65b33eedfdc106d81576d652693fbe7cb668f833)
* maint/**dev**: add '.history' (used by VSCode extension) to .prettierignore &ac; [`792b967`](https://github.com/rivy/js.xdg-portable/commit/792b9677dfa0828a0a0a85216eb55102063ea2f0)
* maint/**dev**: npm script polish &ac; [`0e5ddc0`](https://github.com/rivy/js.xdg-portable/commit/0e5ddc031be944d2e29014ee0e42d87ac21a8e88)
* maint/**dev**: add ESLint (`eslint`) &ac; [`e689bde`](https://github.com/rivy/js.xdg-portable/commit/e689bded7915c7c263e843867ce8aece0b3eb379)
#### Refactoring
* refactor ~ consolidate source code into 'src' directory &ac; [`d4e4ba5`](https://github.com/rivy/js.xdg-portable/commit/d4e4ba53a689168a7750b6f5887ad7bf2076df86)
* refactor ~ consolidate testing code into 'test' directory &ac; [`cdabf1c`](https://github.com/rivy/js.xdg-portable/commit/cdabf1cdd0481e15dc6d2c52a65e1dd2fcca84fe)
* refactor/**polish**: fix ESLint complaints &ac; [`da3bedb`](https://github.com/rivy/js.xdg-portable/commit/da3bedba1b8c9fa78c5d408b3f1b8d60eef8d68f)
* refactor/**polish**: `npx prettier . --write` re-format &ac; [`a4fe2f4`](https://github.com/rivy/js.xdg-portable/commit/a4fe2f4c14e4899352dbe194bd063a79756bc1e9)
---
## [v7.2.2](https://github.com/rivy/js.xdg-portable/compare/v7.2.1...v7.2.2) <small>(2020-09-02)</small>
#### Documentation
* docs ~ update module keywords &ac; [`2959218`](https://github.com/rivy/js.xdg-portable/commit/2959218f2e0e424220b709c69c7e44288f1e6302)
---
## [v7.2.1](https://github.com/rivy/js.xdg-portable/compare/v7.2.0...v7.2.1) <small>(2019-10-04)</small>
#### Maintenance
* maint/**build**: fix missing dev dependencies &ac; [`4ba5ac4`](https://github.com/rivy/js.xdg-portable/commit/4ba5ac454a37e431168e515719bd89624b5c2e51)
---
## [v7.2.0](https://github.com/rivy/js.xdg-portable/compare/v7.1.0...v7.2.0) <small>(2019-10-04)</small>
#### Documentation
* docs ~ update README badges &ac; [`8d2ca20`](https://github.com/rivy/js.xdg-portable/commit/8d2ca209561d7640ba0cafc49d2c858c2b93dd39)
* docs ~ add CHANGELOG &ac; [`14f2fe6`](https://github.com/rivy/js.xdg-portable/commit/14f2fe631e99509f911c7191fad63b5f4c9c438d)
#### Maintenance
* maint/**CI**: add testing for NodeJS v6 &ac; [`be98a00`](https://github.com/rivy/js.xdg-portable/commit/be98a008a056aecb7a59305a20df3bd83dcb5939)
* maint/**build**: refactor lint/test run-scripts &ac; [`5b5b151`](https://github.com/rivy/js.xdg-portable/commit/5b5b151ca96df1b4430b7a041682d42af8dddf2f)
* maint/**build**: add CHANGELOG (using `git-chglog`) configuration &ac; [`f4b46e1`](https://github.com/rivy/js.xdg-portable/commit/f4b46e176d28e5662d0984bbbbf5d0c4831d8808)
#### Refactoring
* refactor ~ support module use back to NodeJS v6 &ac; [`ff43b02`](https://github.com/rivy/js.xdg-portable/commit/ff43b022ec13aac218feac12dcac8e7f907d4ffd)
---
## [v7.1.0](https://github.com/rivy/js.xdg-portable/compare/v7.0.3...v7.1.0) <small>(2019-08-18)</small>
#### Fixes
* fix typescript definitions and testing &ac; [`8c3c6d8`](https://github.com/rivy/js.xdg-portable/commit/8c3c6d820e4471d4a282570b500a319b04802acf)
#### Documentation
* docs ~ fix broken CI README badges by pointing to repo master branch &ac; [`8af5009`](https://github.com/rivy/js.xdg-portable/commit/8af500999bc71f7676868fe9a44dbf7ff0d7a1e4)
---
## [v7.0.3](https://github.com/rivy/js.xdg-portable/compare/v7.0.2...v7.0.3) <small>(2019-07-28)</small>
#### Documentation
* docs ~ fix README usage example &ac; [`963fcd4`](https://github.com/rivy/js.xdg-portable/commit/963fcd4067b04a964428866153018232909880d1)
---
## [v7.0.2](https://github.com/rivy/js.xdg-portable/compare/v7.0.1...v7.0.2) <small>(2019-07-28)</small>
#### Documentation
* docs ~ add example with more object detail &ac; [`338ca45`](https://github.com/rivy/js.xdg-portable/commit/338ca45876ff7dcd465552c6a36b60c1126eae81)
* docs ~ polish README &ac; [`5e76c92`](https://github.com/rivy/js.xdg-portable/commit/5e76c925542968e006964a1259e36dfe2989e1e2)
#### Maintenance
* maint ~ add alternate construction test &ac; [`980f267`](https://github.com/rivy/js.xdg-portable/commit/980f2671bec0538c7a665d67c6983dffb657289d)
#### Refactoring
* refactor ~ clean up internal naming &ac; [`68100c0`](https://github.com/rivy/js.xdg-portable/commit/68100c0d1956827624b45ad6d7d537b6331bcf29)
---
## [v7.0.1](https://github.com/rivy/js.xdg-portable/compare/v7.0.0...v7.0.1) <small>(2019-07-27)</small>
#### Documentation
* docs ~ fix and polish README &ac; [`8da6270`](https://github.com/rivy/js.xdg-portable/commit/8da627034f70beb9b0de88f304bd502380e7782d)
#### Maintenance
* maint ~ add OSX CI testing &ac; [`a80dc4c`](https://github.com/rivy/js.xdg-portable/commit/a80dc4ceab25fd4e2153994f25d9c359d49625e5)
* maint ~ improve code coverage testing and reporting &ac; [`89b2655`](https://github.com/rivy/js.xdg-portable/commit/89b2655d5f1e05c6a93ec4ecd79984257eb6b9d8)
#### Refactoring
* refactor platform testing code &ac; [`d34f19f`](https://github.com/rivy/js.xdg-portable/commit/d34f19f7522fbcca04bb2497a037fe1393a81589)
---
## [v7.0.0](https://github.com/rivy/js.xdg-portable/compare/v6.0.1...v7.0.0) <small>(2019-07-20)</small>
#### Changes
* add npm `cover` script &ac; [`8764397`](https://github.com/rivy/js.xdg-portable/commit/8764397756ad72ee41cd7788c52e15ba6541a177)
* add AppVeyor CI &ac; [`8c7741a`](https://github.com/rivy/js.xdg-portable/commit/8c7741a8166a83af47230c29581867765c1f102b)
* change from property to method interface &ac; [`7b29508`](https://github.com/rivy/js.xdg-portable/commit/7b29508a0f6500a1c8936ada73275411ccb8fea4)
* change ~ remove '.default' export &ac; [`655453f`](https://github.com/rivy/js.xdg-portable/commit/655453f78ad7b06cdc04df2cc41fc567bb5d8e7a)
#### Documentation
* docs ~ add/update README badges &ac; [`4f03c45`](https://github.com/rivy/js.xdg-portable/commit/4f03c454c6a204660873e1c2cacbbe583484af9e)
* docs ~ README update &ac; [`58133d6`](https://github.com/rivy/js.xdg-portable/commit/58133d6c52e7baef5f15c91cdac4489d90e98fd6)
#### Refactoring
* refactor ~ hoist common code from platforms into main module &ac; [`90aa8bc`](https://github.com/rivy/js.xdg-portable/commit/90aa8bce46e71742196f23c5805aa7317a8cb32c)
* refactor ~ improve tests &ac; [`5cb8616`](https://github.com/rivy/js.xdg-portable/commit/5cb86161ab7f95e9f38f35612168199e537cb988)
---
## [v6.0.1](https://github.com/rivy/js.xdg-portable/compare/v6.0.0...v6.0.1) <small>(2019-06-29)</small>
#### Fixes
* fix os.tmpdir() fallback logic &ac; [`c1ee2ea`](https://github.com/rivy/js.xdg-portable/commit/c1ee2ea2e8c8309ae929893e60dc6da4b8fcfbaf)
---
## [v6.0.0](https://github.com/rivy/js.xdg-portable/compare/v4.0.0...v6.0.0) <small>(2019-06-29)</small>
#### Changes
* add eslint support &ac; [`f91b369`](https://github.com/rivy/js.xdg-portable/commit/f91b36991658ae53f35cca4858f354bcbf9e4fc7)
* add os.tmpdir() as a fallback for os.homedir() &ac; [`47cb028`](https://github.com/rivy/js.xdg-portable/commit/47cb028436a80dd85a6cd1e3f509166a8104de57)
* change ~ cleanup type info and tests &ac; [`6bbd9f3`](https://github.com/rivy/js.xdg-portable/commit/6bbd9f307d86c42e15d3501c8f1810a0e2a282c8)
* add STATE directory support &ac; [`1023d63`](https://github.com/rivy/js.xdg-portable/commit/1023d638b3c55b4be4ce1cde8259b4324f907776)
* add example &ac; [`189b29e`](https://github.com/rivy/js.xdg-portable/commit/189b29e41356482c30a0d601f1aa651758975f0b)
* add cross-platform compatiblity &ac; [`cfb3467`](https://github.com/rivy/js.xdg-portable/commit/cfb3467c82e725366c854c578c31d47fe2b0a0f2)
#### Documentation
* docs ~ polish README &ac; [`d678235`](https://github.com/rivy/js.xdg-portable/commit/d67823528a8136bccec723465df99fd830f01db2)
* docs ~ update description and README &ac; [`8e11070`](https://github.com/rivy/js.xdg-portable/commit/8e11070c5bb304bad5e36fe8fc6c8cd87326b74c)
#### Refactoring
* refactor ~ fix lint warnings &ac; [`15555e1`](https://github.com/rivy/js.xdg-portable/commit/15555e16e732e8698b02812fbd3c44b47d42e67b)
* refactor ~ reorder tests &ac; [`dc035e5`](https://github.com/rivy/js.xdg-portable/commit/dc035e5278cf25479d45959dcc28a65d9d34eb5c)
* refactor ~ reorder/sort function definitions &ac; [`52ef262`](https://github.com/rivy/js.xdg-portable/commit/52ef2621f36f523c06b43ee05a29f5a232bdcd63)
---
## [v4.0.0](https://github.com/rivy/js.xdg-portable/compare/v3.0.0...v4.0.0) <small>(2019-04-30)</small>
*No changelog for this release.*
---
## [v3.0.0](https://github.com/rivy/js.xdg-portable/compare/v2.0.0...v3.0.0) <small>(2017-02-13)</small>
#### Dependency Updates
* update tests for latest AVA version &ac; [`85a4aaa`](https://github.com/rivy/js.xdg-portable/commit/85a4aaa0d9ebb91be2f7a7c608c0e03c93b20afe)
---
## [v2.0.0](https://github.com/rivy/js.xdg-portable/compare/v1.0.1...v2.0.0) <small>(2015-06-13)</small>
#### Fixes
* fix XDG_CACHE_HOME + tests &ac; [`d75b14d`](https://github.com/rivy/js.xdg-portable/commit/d75b14d0055ab19e435872ba92c4169284d9042d)
#### Dependency Updates
* Update .travis.yml &ac; [`cd4a8b3`](https://github.com/rivy/js.xdg-portable/commit/cd4a8b3ddb5dfa76bc0b827ef9c8b9fd92dd23e4)
#### Pull Requests
* Merge pull request [#1](https://github.com/rivy/js.xdg-portable/issues/1) from chocolateboy/fix_xdg_cache_home_and_tests
---
## [v1.0.1](https://github.com/rivy/js.xdg-portable/compare/v1.0.0...v1.0.1) <small>(2015-01-14)</small>
*No changelog for this release.*
---
## v1.0.0 <small>(2014-10-06)</small>
*No changelog for this release.*

10
node_modules/xdg-portable/LICENSE generated vendored Normal file
View file

@ -0,0 +1,10 @@
MIT License
Copyright (c) Roy Ivy III <rivy.dev@gmail.com>
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.

276
node_modules/xdg-portable/README.md generated vendored Normal file
View file

@ -0,0 +1,276 @@
<!DOCTYPE markdown><!-- markdownlint-disable no-inline-html -->
<meta charset="utf-8" content="text/markdown" lang="en">
<!-- -## editors ## (emacs/sublime) -*- coding: utf8-nix; tab-width: 4; mode: markdown; indent-tabs-mode: nil; basic-offset: 2; st-word_wrap: 'true' -*- ## (jEdit) :tabSize=4:indentSize=4:mode=markdown: ## (notepad++) vim:tabstop=4:syntax=markdown:expandtab:smarttab:softtabstop=2 ## modeline (see <https://archive.is/djTUD>@@<http://webcitation.org/66W3EhCAP> ) -->
<!-- spell-checker:ignore expandtab markdownlint modeline smarttab softtabstop -->
<!-- markdownlint-disable heading-increment -->
<!-- spell-checker:ignore (names) rivy Sindre sindresorhus Sorhus -->
<!-- spell-checker:ignore (abbrev/jargon) CICD NodeJS -->
<!-- spell-checker:ignore (platform/windows) APPDATA LOCALAPPDATA -->
<!-- spell-checker:ignore () archlinux readonly subdir tmpdir -->
# [xdg-portable](https://github.com/rivy/js.xdg-portable)
> Get [XDG Base Directory](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) paths (cross-platform)
[![Build status][gha-image]][gha-url]
[![Build status][travis-image]][travis-url]
[![Build status][appveyor-image]][appveyor-url]
[![Coverage status][coverage-image]][coverage-url]
[![License][license-image]][license-url]
[![Style Guide][style-image]][style-url]
&nbsp; <br/>
[![Repository][repository-image]][repository-url]
[![NPM version][npm-image]][npm-url]
[![NodeJS version][nodejsv-image]][repository-url]
[![Downloads][downloads-image]][downloads-url]
<!--
XDG references
# ref: <https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html> @@ <https://archive.is/aAhtw>
# ref: <https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html> @@ <https://archive.is/7N0TN>
# ref: <https://wiki.archlinux.org/index.php/XDG_Base_Directory> @@ <https://archive.is/VdO9n>
# ref: <https://wiki.debian.org/XDGBaseDirectorySpecification#state> @@ <http://archive.is/pahId>
# ref: <https://ploum.net/207-modify-your-application-to-use-xdg-folders> @@ <https://archive.is/f43Gk>
-->
## Installation
```shell
npm install xdg-portable
```
## Usage
```js
const xdg = require('xdg-portable');
const locatePath = require('locatePath');
const mkdirp = require('mkdirp');
configDir = xdg.config();
//(mac)=> '/Users/rivy/Library/Preferences'
//(nix)=> '/home/rivy/.config'
//(win)=> 'C:\\Users\\rivy\\AppData\\Roaming\\xdg.config'
dataDirs = xdg.dataDirs();
//(mac)=> ['/Users/rivy/Library/Application Support']
//(nix)=> ['/home/rivy/.local/share', '/usr/local/share/', '/usr/share/']
//(win)=> ['C:\\Users\\rivy\\AppData\\Roaming\\xdg.data']
stateDir = xdg.state();
//(mac)=> '/Users/rivy/Library/State'
//(nix)=> '/home/rivy/.local/state'
//(win)=> 'C:\\Users\\rivy\\AppData\\Local\\xdg.state'
mkdirp.sync(configDir, 0o700);
const dataDir = locatePath.sync(dataDirs) || dataDirs[0];
mkdirp.sync(dataDir, 0o700);
mkdirp.sync(stateDir, 0o700);
```
## API
### Initialization
#### `require('xdg-portable'): XDGPortable()`
```js
const xdg = require('xdg-portable');
```
The object returned by the module constructor is an XDGPortable Function object, augmented with attached methods. When called directly (eg, `const p = xdg()`), it returns a newly constructed XDGPortable object. Since the XDGPortable object contains no instance state, all constructed objects will be functionally identical.
### Methods
All module methods return platform-compatible path strings.
The returned paths are simple strings and are _not_ guaranteed to exist. The application is responsible for construction of the directories when needed. If needed, [`make-dir`](https://www.npmjs.com/package/make-dir) or [`mkdirp`](https://www.npmjs.com/package/mkdirp) can be used to create the directories.
#### `xdg.cache(): string`
Returns the directory for user-specific non-essential (cached) data files
> Deletion of the data contained here might cause the application to slow down.
This location would be analogous to _/var/cache_ for \*nix.
`%LocalAppData%\xdg.cache` is the default for the windows platform.
#### `xdg.config(): string`
Returns the directory for user-specific configuration files
> Deletion of the data contained here might require the user to reconfigure the application.
This location would be analogous to _/etc_ for \*nix.
`%AppData%\xdg.config` is the default for the windows platform.
#### `xdg.data(): string`
Returns the directory for user-specific data files
> Deletion of the data contained here might force the user to restore from backups.
This location would be analogous to _/usr/share_ for \*nix.
`%AppData%\xdg.data` is the default for the windows platform.
#### `xdg.runtime(): string?`
Returns the directory for user-specific non-essential runtime data files (such as sockets, named pipes, etc); may be `undefined`
> Deletion of the data contained here might interfere with the currently executing application but should have no effect on future executions.
The XDG specification defines some fairly strict specifications for a "runtime"-data candidate directory. To meet these criteria, the directory must usually be supplied by the OS. The user may override this by using the `XDG_RUNTIME_DIR` environment variable.
`undefined` is the default for the windows platform.
- ref: [archlinux ~ XDG Base Directory](https://wiki.archlinux.org/index.php/XDG_Base_Directory#User_directories)
#### `xdg.state(): string`
Returns the directory for user-specific state files (non-essential and more volatile than configuration files)
> Deletion of the data contained here should not materially interfere with execution of the application.
This location might hold data such as backups, input history, logs, recent file lists, visual application state, etc.
`%LocalAppData%\xdg.state` is the default for the windows platform.
#### `xdg.configDirs(): readonly string[]`
Returns a reference-ordered array of base directories to search for configuration files (includes `.config()` as the first entry)
#### `xdg.dataDirs(): readonly string[]`
Returns a preference-ordered array of base directories to search for data files (includes `.data()` as the first entry)
## Discussion
The [XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) defines categories of user information (ie, "cache", "config", "data", ...), defines their standard storage locations, and defines the standard process for user configuration of those locations (using `XDG_CACHE_HOME`, etc).
Applications supporting the XDG convention are expected to store user-specific files within these locations, either within the common/shared directory (eg, `` `${xdg.cache()}/filename` ``) or within a more isolated application-defined subdirectory (eg, `` `${xdg.config()}/dir/filename` ``; `dir` usually being the application name).
### Windows ("win32") specific notes
Windows has an alternate convention, offering just two standard locations for applications to persist data, either `%APPDATA%` (for files which may "roam" with the user between hosts) and `%LOCALAPPDATA%` (for local-machine-only files). All application files are expected to be stored within an application-unique subdirectory in one of those two locations, usually under a directory matching the application name. There is no further popular convention used to segregate the file types (ie, into "cache", "config", ...) in any way similar to the XDG specification.
So, to support basic XDG-like behavior (that is, segregating the information types into type-specific directories), this module creates a new convention for Windows hosts, placing the specific types of files into subdirectories under either `%APPDATA%` or `%LOCALAPPDATA%`, as appropriate for the file type. For example, "cache"-type files will be offered placement into `%LOCALAPPDATA%\xdg.cache`, "config"-type files into `%APPDATA%\xdg.config`, "data"-type files into `%APPDATA%\xdg.data`, etc.
[`xdg-app-paths`](https://www.npmjs.com/package/xdg-app-paths) builds on this module and offers application specific paths more in-line with usual platform conventions, but still compatible with the XDG specification.
### Fallback to `os.tmpdir()`
In the uncommon case that both the XDG environment variable is not set and the users home directory can't be found, `os.tmpdir()` will be used as a fallback for the missing `os.homedir()` value.
### Origins
This module was forked from [sindresorhus/xdg-basedir](https://github.com/sindresorhus/xdg-basedir) in order to add cross-platform portability and support simpler cross-platform applications.
- ref: <https://github.com/sindresorhus/xdg-basedir/pull/4>
## Building and Contributing
### Build requirements
- NodeJS >= 6.0
- a JavaScript package/project manager ([`npm`](https://www.npmjs.com/get-npm) or [`yarn`](https://yarnpkg.com))
> #### optional
>
> - [`git-changelog`](https://github.com/rivy-go/git-changelog) ... enables changelog automation
### Build/test
```shell
npm install
npm test
```
### Project development scripts
```shell
> npm run help
...
usage: `npm run TARGET [TARGET..]`
TARGETs:
coverage calculate and display (or send) code coverage [alias: 'cov']
fix fix package issues (automated/non-interactive)
fix:lint fix `ESLint` issues
fix:style fix `Prettier` formatting issues
help display help
lint check for package code 'lint'
lint:lint check for code 'lint' (using `ESLint`)
lint:spell check for spelling errors (using `cSpell`)
lint:style check for format imperfections (using `Prettier`)
lint:types check for type declaration errors (using `tsd`)
test test package
test:code test package code
update:changelog update CHANGELOG (using `git changelog ...`)
```
### Contributions
Contributions are welcome.
Any pull requests should be based off of the default branch (`master`). And, whenever possible, please include tests for any new code, ensuring that local (via `npm test`) and remote CI testing passes.
By contributing to the project, you are agreeing to provide your contributions under the same [license](./LICENSE) as the project itself.
## Related
- [`xdg-app-paths`](https://www.npmjs.com/package/xdg-app-paths) ... easy XDG for applications
- [`xdg-basedir`](https://www.npmjs.com/package/xdg-basedir) ... inspiration for this module
## License
[MIT](./LICENSE) © [Roy Ivy III](https://github.com/rivy), [Sindre Sorhus](https://sindresorhus.com)
<!-- badge references -->
[repository-image]: https://img.shields.io/github/v/tag/rivy/js.xdg-portable?label=%E2%81%A3&logo=github&logoColor=white
[repository-url]: https://github.com/rivy/js.xdg-portable
[license-image]: https://img.shields.io/npm/l/xdg-portable.svg?color=royalblue&style=flat
[license-url]: license
[nodejsv-image]: https://img.shields.io/node/v/xdg-portable?color=blue
[style-image]: https://img.shields.io/badge/code_style-prettier-mediumvioletred.svg
[style-url]: https://prettier.io
<!-- Continuous integration/deployment (CICD) -->
[appveyor-image]: https://img.shields.io/appveyor/ci/rivy/js-xdg-portable/master.svg?style=flat&logo=AppVeyor&logoColor=deepskyblue
[appveyor-url]: https://ci.appveyor.com/project/rivy/js-xdg-portable
[gha-image]: https://img.shields.io/github/workflow/status/rivy/js.xdg-portable/CI?label=CI&logo=github
[gha-url]: https://github.com/rivy/js.xdg-portable/actions?query=workflow%3ACI
[travis-image]: https://img.shields.io/travis/rivy/js.xdg-portable/master.svg?style=flat&logo=travis
[travis-url]: https://travis-ci.org/rivy/js.xdg-portable
<!-- Code quality -->
[coverage-image]: https://img.shields.io/codecov/c/github/rivy/js.xdg-portable/master.svg
[coverage-url]: https://codecov.io/gh/rivy/js.xdg-portable
<!-- Distributors/Registries -->
[npm-image]: https://img.shields.io/npm/v/xdg-portable.svg?style=flat
[npm-url]: https://npmjs.org/package/xdg-portable
[downloads-image]: http://img.shields.io/npm/dm/xdg-portable.svg?style=flat
[downloads-url]: https://npmjs.org/package/xdg-portable
<!-- Alternate/Old image/URL links -->
<!-- [appveyor-image]: https://ci.appveyor.com/api/projects/status/.../branch/master?svg=true -->
<!-- [coverage-image]: https://img.shields.io/coveralls/github/rivy/xdg-portable/master.svg -->
<!-- [coverage-url]: https://coveralls.io/github/rivy/xdg-portable -->
<!-- [npm-image]: https://img.shields.io/npm/v/xdg-portable.svg?style=flat&label=npm&logo=NPM&logoColor=linen -->
<!-- [repository-image]:https://img.shields.io/badge/%E2%9D%A4-darkcyan?style=flat&logo=github -->
<!-- [style-image]: https://img.shields.io/badge/code_style-standard-darkcyan.svg -->
<!-- [style-url]: https://standardjs.com -->
<!-- [travis-image]: https://img.shields.io/travis/rivy/js.xdg-portable/master.svg?style=flat&logo=Travis-CI&logoColor=silver -->
<!-- [travis-image]: https://travis-ci.org/rivy/js.xdg-portable.svg?branch=master -->

139
node_modules/xdg-portable/package.json generated vendored Normal file
View file

@ -0,0 +1,139 @@
{
"name": "xdg-portable",
"version": "7.3.0",
"description": "Generate portable XDG Base Directory paths",
"license": "MIT",
"repository": "rivy/js.xdg-portable",
"author": {
"name": "Roy Ivy III",
"email": "rivy.dev@gmail.com"
},
"engines": {
"node": ">= 6.0"
},
"files": [
"src/**/*",
"CHANGELOG.mkd",
"LICENSE",
"README.md"
],
"main": "src/lib/index.js",
"types": "src/lib/index.d.ts",
"keywords": [
"base",
"cache",
"common",
"config",
"cross-platform",
"data",
"directory",
"environment",
"linux",
"mac",
"macos",
"node6",
"osx",
"path",
"paths",
"portable",
"runtime",
"state",
"unix",
"windows",
"xdg"
],
"scripts": {
"# coverage # calcuate and display (or send) code coverage [alias: 'cov']": "",
"coverage": "run-s --silent _:max-node-8 && echo-cli \"[coverage] WARN Code coverage skipped [for NodeJS < v10]\" 1>&2 || run-s _:coverage",
"cov": "run-s coverage",
"cov:html": "nyc report --reporter=html",
"cov:send": "nyc report --reporter=text-lcov | codecov --disable=gcov --pipe",
"cov:text": "nyc report",
"cov:view": "run-s cov:html && cd coverage && open-cli index.html",
"# fix # fix package issues (automated/non-interactive)": "",
"fix": "run-s fix:*",
"# fix:lint # fix `ESLint` issues": "",
"fix:lint": "eslint . --fix",
"# fix:style # fix `Prettier` formatting issues": "",
"fix:style": "prettier . --write",
"# help # display help": "",
"help": "< package.json node -e \"s = {p:'',e:'npm'}; if (new String(process.env.npm_execpath).match(/yarn.js$/)) { s = {p:'\\n',e:'yarn'}; }; console.log('%susage: \\`%s run TARGET [TARGET..]\\`\\n\\nTARGETs:\\n', s.p, s.e); re = /^.*?\\x22(?:\\W+\\s*)([^#\\x22]+)\\s+#+\\s+([^#\\x22]+?)(\\s+#+)?\\x22.*$/; require('readline').createInterface({ input: process.stdin, output: process.stdout, terminal: false }).on('line', function(line){ if (match = re.exec(line)) { console.log('%s %s', match[1].padEnd(19), match[2]); } });\"",
"# lint # check for package code 'lint'": "",
"lint": "run-s --silent _:max-node-8 && echo-cli \"[lint] WARN Lint checks skipped [for NodeJS < v10]\" 1>&2 || run-p lint:*",
"# lint:lint # check for code 'lint' (using `ESLint`)": "",
"lint:lint": "eslint .",
"# lint:spell # check for spelling errors (using `cSpell`)": "",
"lint:spell": "cspell {eg,examples,src,test}/**/* CHANGELOG{,.md,.mkd} README{,.md,.mkd} --no-summary",
"# lint:style # check for format imperfections (using `Prettier`)": "",
"lint:style": "prettier . --list-different",
"# lint:types # check for type declaration errors (using `tsd`)": "",
"lint:types": "tsd",
"# test # test package": "",
"test": "run-s lint && run-p test:*",
"# test:code # test package code": "",
"test:code": "nyc --silent ava",
"# update:changelog # update CHANGELOG (using `git changelog ...`)": "",
"update:changelog": "run-s --silent _:update:changelog && echo-cli \"[update] info CHANGELOG updated\"",
"_:coverage": "is-ci && run-s cov:send || run-s cov:view",
"_:exists:git-changelog": "node -e \"if (!require('command-exists').sync('git-changelog')){process.exit(1);};\" || (echo-cli \"WARN `git-changelog` missing (try `go get -u github.com/rivy-go/git-changelog/cmd/git-changelog`)\" & exit 1)",
"_:max-node-8": "is-node-not-modern 10",
"_:min-node-10": "is-node-modern 10",
"_:vcs-clean": "git diff --quiet",
"_:vcs-clean-err": "run-s --silent _:vcs-clean || (echo-cli \"[vcs] ERR! Uncommitted changes\" 1>&2 & exit 1)",
"_:vcs-strictly-clean": "git status --porcelain | node -e \"process.stdin.on('data',function(_){process.exit(1);});\"",
"_:vcs-strictly-clean-err": "run-s --silent _:vcs-strictly-clean || (echo-cli \"[vcs] ERR! Uncommitted changes and/or untracked files\" 1>&2 & exit 1)",
"_:update:changelog": "run-s --silent _:exists:git-changelog && git changelog > CHANGELOG.mkd || echo-cli \"[update] info CHANGELOG not updated\" 1>&2",
"_:version:update:changelog": "run-s --silent _:exists:git-changelog && node -e \"v=require('./package.json').version; result=require('child_process').spawnSync('git changelog --next-tag v'+v,{shell:true,encoding:'utf-8'}); if (result.status != 0) {console.error('ERR! '+result.stderr); process.exit(1);} else {require('fs').writeFileSync('CHANGELOG.mkd',result.stdout);};\" || echo-cli \"[version] WARN CHANGELOG not updated\" 1>&2",
"prepublishOnly": "run-s update:* test _:vcs-strictly-clean-err",
"preversion": "run-s test",
"version": "run-s _:version:update:changelog lint:spell && git add CHANGELOG.mkd"
},
"dependencies": {
"os-paths": "^4.0.1"
},
"devDependencies:#": "* for testing, Node-v6 requires ava < v2 and nyc < v15",
"devDependencies": {
"ava": "^1.4.1",
"codecov": "^3.5.0",
"command-exists": "^1.2.9",
"coveralls": "^3.0.5",
"cross-spawn": "^6.0.5",
"cspell": "^4.1.2",
"echo-cli": "^1.0.8",
"eslint": "^7.11.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.22.0",
"is-ci": "^2.0.0",
"is-node-modern": "^1.0.0",
"npm-run-all": "^4.1.5",
"nyc": "^14.1.1",
"open-cli": "^6.0.1",
"prettier": "^2.1.1",
"tsd": "^0.13.1"
},
"optionalDependencies": {},
"prettier # overrides/[*.markdown]/tabWidth": "// set to 4 when https://github.com/prettier/prettier/issues/5019 is fixed",
"prettier": {
"printWidth": 100,
"singleQuote": true,
"useTabs": true,
"tabWidth": 2,
"overrides": [
{
"files": [
"*.md",
"*.mkd",
"*.markdown"
],
"options": {
"tabWidth": 2,
"useTabs": false
}
}
]
},
"tsd": {
"directory": "test"
}
}

110
node_modules/xdg-portable/src/lib/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,110 @@
// # spell-checker:ignore rivy
declare namespace XDG {
/**
Directory for user-specific non-essential data files.
@example
```js
import xdg = require('xdg-portable');
xdg.cache();
//(mac)=> '/Users/rivy/Library/Caches'
//(nix)=> '/home/rivy/.cache'
//(win)=> 'C:\\Users\\rivy\\AppData\\Local\\cache'
```
*/
function cache(): string;
/**
Directory for user-specific configuration files.
@example
```js
import xdg = require('xdg-portable');
xdg.config();
//(mac)=> '/Users/rivy/Library/Preferences'
//(nix)=> '/home/rivy/.config'
//(win)=> 'C:\\Users\\rivy\\AppData\\Roaming\\xdg.config'
```
*/
function config(): string;
/**
Directory for user-specific data files.
@example
```js
import xdg = require('xdg-portable');
xdg.data();
//(mac)=> '/Users/rivy/Library/Application Support'
//(nix)=> '/home/rivy/.local/share'
//(win)=> 'C:\\Users\\rivy\\AppData\\Roaming\\xdg.data'
```
*/
function data(): string;
/**
Directory for user-specific non-essential runtime files and other file objects (such as sockets, named pipes, etc).
@example
```js
import xdg = require('xdg-portable');
xdg.runtime();
//(mac)=> undefined
//(nix)=> '/run/user/rivy'
//(win)=> undefined
```
*/
function runtime(): string | undefined;
/**
Directory for user-specific state files (non-essential and more volatile than configuration files).
@example
```js
import xdg = require('xdg-portable');
xdg.state();
//(mac)=> '/Users/rivy/Library/State'
//(nix)=> '/home/rivy/.local/state'
//(win)=> 'C:\\Users\\rivy\\AppData\\Local\\xdg.state'
```
*/
function state(): string;
/**
Preference-ordered array of base directories to search for configuration files; includes `.config()` directory as first entry.
@example
```js
import xdg = require('xdg-portable');
xdg.configDirs();
//(mac)=> ['/Users/rivy/Library/Preferences']
//(nix)=> ['/home/rivy/.config', '/etc/xdg']
//(win)=> ['C:\\Users\\rivy\\AppData\\Roaming\\xdg.config']
```
*/
function configDirs(): readonly string[];
/**
Preference-ordered array of base directories to search for data files; include `.data()` directory as first entry.
@example
```js
import xdg = require('xdg-portable');
xdg.dataDirs();
//(mac)=> ['/Users/rivy/Library/Preferences']
//(nix)=> ['/home/rivy/.local/share', '/usr/local/share/', '/usr/share/']
//(win)=> ['C:\\Users\\rivy\\AppData\\Roaming\\xdg.data']
```
*/
function dataDirs(): readonly string[];
}
declare function XDG(): typeof XDG;
export = XDG;

127
node_modules/xdg-portable/src/lib/index.js generated vendored Normal file
View file

@ -0,0 +1,127 @@
// # spell-checker:ignore macos APPDATA LOCALAPPDATA
/* eslint-env es6, node */
'use strict';
const path = require('path');
const osPaths = require('os-paths');
// XDG references
// # ref: <https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html> @@ <https://archive.is/aAhtw>
// # ref: <https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html> @@ <https://archive.is/7N0TN>
// # ref: <https://wiki.archlinux.org/index.php/XDG_Base_Directory> @@ <https://archive.is/VdO9n>
// # ref: <https://wiki.debian.org/XDGBaseDirectorySpecification#state> @@ <http://archive.is/pahId>
// # ref: <https://ploum.net/207-modify-your-application-to-use-xdg-folders> @@ <https://archive.is/f43Gk>
const linux = () => {
const object = {};
object.cache = () =>
process.env.XDG_CACHE_HOME || path.join(osPaths.home() || osPaths.temp(), '.cache');
object.config = () =>
process.env.XDG_CONFIG_HOME || path.join(osPaths.home() || osPaths.temp(), '.config');
object.data = () =>
process.env.XDG_DATA_HOME || path.join(osPaths.home() || osPaths.temp(), '.local', 'share');
object.runtime = () => process.env.XDG_RUNTIME_DIR || undefined;
object.state = () =>
process.env.XDG_STATE_HOME || path.join(osPaths.home() || osPaths.temp(), '.local', 'state');
return object;
};
const macos = () => {
const object = {};
object.cache = () =>
process.env.XDG_CACHE_HOME ||
path.join(path.join(osPaths.home() || osPaths.temp(), 'Library'), 'Caches');
object.config = () =>
process.env.XDG_CONFIG_HOME ||
path.join(path.join(osPaths.home() || osPaths.temp(), 'Library'), 'Preferences');
object.data = () =>
process.env.XDG_DATA_HOME ||
path.join(path.join(osPaths.home() || osPaths.temp(), 'Library'), 'Application Support');
object.runtime = () => process.env.XDG_RUNTIME_DIR || undefined;
object.state = () =>
process.env.XDG_STATE_HOME ||
path.join(path.join(osPaths.home() || osPaths.temp(), 'Library'), 'State');
return object;
};
const windows = () => {
const object = {};
// # ref: <https://www.thewindowsclub.com/local-localnow-roaming-folders-windows-10> @@ <http://archive.is/tDEPl>
// Locations for cache/config/data/state are invented (Windows doesn't have a popular convention)
object.cache = () => {
const localAppData =
process.env.LOCALAPPDATA || path.join(osPaths.home() || osPaths.temp(), 'AppData', 'Local'); // "AppData/Local" contains local-machine-only user data
return process.env.XDG_CACHE_HOME || path.join(localAppData, 'xdg.cache');
};
object.config = () => {
const appData =
process.env.APPDATA || path.join(osPaths.home() || osPaths.temp(), 'AppData', 'Roaming'); // "AppData/Roaming" contains data which may follow user between machines
return process.env.XDG_CONFIG_HOME || path.join(appData, 'xdg.config');
};
object.data = () => {
const appData =
process.env.APPDATA || path.join(osPaths.home() || osPaths.temp(), 'AppData', 'Roaming'); // "AppData/Roaming" contains data which may follow user between machines
return process.env.XDG_DATA_HOME || path.join(appData, 'xdg.data');
};
object.runtime = () => process.env.XDG_RUNTIME_DIR || undefined;
object.state = () => {
const localAppData =
process.env.LOCALAPPDATA || path.join(osPaths.home() || osPaths.temp(), 'AppData', 'Local'); // "AppData/Local" contains local-machine-only user data
return process.env.XDG_STATE_HOME || path.join(localAppData, 'xdg.state');
};
return object;
};
const _XDGPortable = () => {
const XDGPortable = function () {
return _XDGPortable();
};
let extension = {};
if (/^darwin$/i.test(process.platform)) {
extension = macos();
} else if (/^win/i.test(process.platform)) {
extension = windows();
} else {
extension = linux();
}
extension.configDirs = () => {
const dirs = [];
dirs.push(extension.config());
if (process.env.XDG_CONFIG_DIRS) {
dirs.push(...process.env.XDG_CONFIG_DIRS.split(path.delimiter));
}
return dirs;
};
extension.dataDirs = () => {
const dirs = [];
dirs.push(extension.data());
if (process.env.XDG_DATA_DIRS) {
dirs.push(...process.env.XDG_DATA_DIRS.split(path.delimiter));
}
return dirs;
};
Object.keys(extension).forEach((key) => {
XDGPortable[key] = extension[key];
});
return XDGPortable;
};
module.exports = _XDGPortable();