5.1.0 • Published 3 years ago

xdg-basedir v5.1.0

Weekly downloads
9,342,050
License
MIT
Repository
github
Last release
3 years ago

xdg-basedir

Get XDG Base Directory 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 for that.

Install

$ npm install xdg-basedir

Usage

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.

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.


configstoreupdate-notifierarchetype-librarycloudstudioeasy-select-rnreact-native-bluetooth2killi8n-react-native-fast-imagetroglodyte@cashremit/cr-streamline-iconsairscanairscan-examplereact-native-esc-pos-sahaab@borisovart/atol-kkt-moduledeneme323112@ntt_app/react-native-custom-notificationturing-codediscord-music-botsreact-native-covid-sdkinotifywait-pathzsh-goggles@saeon/quick-formmysql-formatreact-native-printer-brothersreact-native-shekhar-bridge-testcogoportutilsdyx-react@oiti/documentoscopy-react-nativequoc-testunblock-block-save-variables@infinitebrahmanuniverse/nolb-xdluminos-ui-corejawwy-sdkjawwy_gamification_release@everything-registry/sub-chunk-3178react-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgreact-native-jawwy_samplepolen-web-components-reactpnm-yph-react-native-custom-componentsproject-wajs-dv@gatsbyjs/update-notifierweb-component-tester-bundlezeo-collectzsh-search-history@geeky-apo/react-native-advanced-clipboardwifi_configuration_packagewodax-update-notifierwangyaling-1ayeoman-remoteyou-get-httpsxo-clixdg-appsxdg-trashdirxdg-trashdir-fixedyapijyapij-jsyangtao-jsupdate-notifier-cjsupdate-notifier-gitupdate-notifier-newupdate-notifier-plusupdate-notifier-webpackupdate-notifier2vue-v3-yandex-metrikavite_vue3_ts_ssssdddddyyyyvscode-ripgrep-with-github-api-error-fixvoodoo-opt@hemith/react-native-tnkfluent.adflow.reactnativesdk-alphafluent.adflow.reactnativesdkfmsl3.0.0jawwy_library_newjawy_library_v1gamification-jawwy-libraryframework_test_library_sixdee_new_jawwytest_lib_module_aarreact-native-create-video-thumbnailreact-native-android-video-player-viewreact-native-animate-textreact-native-additionreact-native-pulsator-nativereact-native-plugpag-wrapperreact-native-rom-componentsreact-native-rtn-ips-poslin-testreact-native-savczuk-feature-libraryreact-native-sandycomponentreact-native-shared-gesturereact-native-recent-framework-updatereact-native-reanimated-sortable-listreact-native-omental-frameworkreact-native-onrampreact-native-screen-idle-timerreact-native-scroll-tab-to-indexreact-native-progress-arrowreact-native-simple-timelinereact-native-sixdee_test_libreact-native-sp-test-common
5.1.0

3 years ago

5.0.1

3 years ago

5.0.0

3 years ago

4.0.0

5 years ago

3.0.0

7 years ago

2.0.0

9 years ago

1.0.1

9 years ago

1.0.0

10 years ago