You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-164Lines changed: 6 additions & 164 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# @folder/xdg[](https://www.npmjs.com/package/@folder/xdg)[](https://npmjs.org/package/@folder/xdg)[](https://npmjs.org/package/@folder/xdg)
2
2
3
-
> Get cross-platform XDG Base Directories or their equivalents. Works with Linux, Windows, or MacOS.
3
+
> Get cross-platform XDG Base Directories or their equivalents. Works with Linux, Windows (win32), or MacOS (darwin).
4
4
5
5
Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
6
6
@@ -251,7 +251,7 @@ The main export, and each method, returns an object with the following propertie
251
251
252
252
## Main Export
253
253
254
-
### [xdg](index.js#L18)
254
+
### [xdg](index.js#L17)
255
255
256
256
Get the XDG Base Directory paths for Linux, or equivalent paths for Windows or MaxOS.
257
257
@@ -260,7 +260,7 @@ Get the XDG Base Directory paths for Linux, or equivalent paths for Windows or M
260
260
*`options`**{Object}**
261
261
*`returns`**{Object}**: Returns an object of paths for the current platform.
262
262
263
-
### [.darwin](index.js#L44)
263
+
### [.darwin](index.js#L42)
264
264
265
265
Get XDG equivalent paths for MacOS. Used by the main export when `process.platform` is `darwin`. Aliased as `xdg.macos()`.
266
266
@@ -277,7 +277,7 @@ const dirs = xdg.darwin();
277
277
constdirs=xdg.macos();
278
278
```
279
279
280
-
### [.linux](index.js#L89)
280
+
### [.linux](index.js#L93)
281
281
282
282
Get XDG equivalent paths for Linux. Used by the main export when `process.platform` is `linux`.
283
283
@@ -290,7 +290,7 @@ Get XDG equivalent paths for Linux. Used by the main export when `process.platfo
290
290
constdirs=xdg.linux();
291
291
```
292
292
293
-
### [.win32](index.js#L136)
293
+
### [.win32](index.js#L145)
294
294
295
295
Get XDG equivalent paths for MacOS. Used by the main export when `process.platform` is `win32`. Aliased as `xdg.windows()`.
296
296
@@ -307,164 +307,6 @@ const dirs = xdg.win32();
307
307
constdirs=xdg.windows();
308
308
```
309
309
310
-
### [.userdirs()](lib/userdirs.js#L17)
311
-
312
-
Get the XDG User Directories for Linux, or equivalents for Windows or MaxOS.
313
-
314
-
**Params**
315
-
316
-
*`options`**{Object}**
317
-
*`returns`**{Object}**: Returns an object of directory paths.
318
-
319
-
### [.userdirs.expand()](lib/userdirs.js#L39)
320
-
321
-
Returns an object to with paths to `user-dirs.*` files, as well as functions to
322
-
load each file.
323
-
324
-
**Params**
325
-
326
-
*`options`**{Object}**
327
-
*`paths`**{Object}**: Optionally pass the paths from the `userdirs()` function to avoid creating them again.
328
-
*`returns`**{Object}**: Returns an object with a `paths` object, and `config`, `defaults`, `dirs`, and `create` functions for actually loading the user-dir files.
329
-
330
-
### [.userdirs.conf()](lib/userdirs.js#L76)
331
-
332
-
Loads and parses the contents of `user-dirs.conf`, if one exists in user home.
Get the actual XDG User Directories to use for MacOS. Gets the `user-dirs.conf`, `user-dirs.defaults`, and the `user-dirs.dirs` files and, if not disabled in `user-dirs.conf`, merges the values in defaults and dirs to create the paths to use.
401
-
402
-
**Params**
403
-
404
-
*`options`**{Object}**
405
-
*`returns`**{Object}**: Returns an object of paths.
Get the XDG User Directories for MacOS. This method is used by the main function when `process.platform` is `darwin`. Exposed as a method so you can call it directly if necessary. Also aliased as `userdirs.macos()`.
428
-
429
-
**Params**
430
-
431
-
*`options`**{Object}**
432
-
*`returns`**{Object}**: Returns an object of paths.
433
-
434
-
**Example**
435
-
436
-
```js
437
-
const { dirs, conf, defaults } =userdirs.darwin(); // or userdirs.macos();
438
-
```
439
-
440
-
### [.userdirs.linux()](lib/userdirs.js#L209)
441
-
442
-
Gets the XDG User Directories for Linux. Used by the main export when `process.platform` is `linux`.
443
-
444
-
*`returns`**{Object}**: Returns an object of paths.
445
-
*`returns`**{Object}**: Returns an object of paths.
446
-
447
-
**Example**
448
-
449
-
```js
450
-
const { dirs, conf, defaults } =userdirs.linux();
451
-
```
452
-
453
-
### [.userdirs.win32()](lib/userdirs.js#L235)
454
-
455
-
Gets the XDG User Directories for MacOS. Used by the `userdirs()` function when `process.platform` is `win32`. Also aliased as `userdirs.windows()`.
456
-
457
-
**Params**
458
-
459
-
*`options`**{Object}**
460
-
*`returns`**{Object}**: Returns an object of paths.
461
-
462
-
**Example**
463
-
464
-
```js
465
-
const { dirs, conf, defaults } =userdirs.win32(); // or userdirs.windows();
466
-
```
467
-
468
310
## XDG Base Directories
469
311
470
312
This documentation is from the Arch Linux [XDG Base Directory](https://wiki.archlinux.org/index.php/XDG_Base_Directory) docs.
@@ -563,4 +405,4 @@ Released under the MIT License.
563
405
564
406
***
565
407
566
-
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on July 22, 2023._
408
+
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on July 24, 2023._
0 commit comments