{"name":"xdg-basedir","version":"5.0.0","description":"Get XDG Base Directory paths","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/xdg-basedir.git"},"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"},"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},"gitHead":"47109e5e93484fe9e07c4ed19a9458baf8b9c845","bugs":{"url":"https://github.com/sindresorhus/xdg-basedir/issues"},"homepage":"https://github.com/sindresorhus/xdg-basedir#readme","_id":"xdg-basedir@5.0.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-LfppoQHWbQjyZvOYvWs1IlcdG9ZYXtxkTcXmIdLgHAFJzExQm4TmHsujT/jSL+dE0EOQ6LNesHyB+Tr7D/5byQ==","shasum":"435b5b342501e23b8b876d5567acf650b187d935","tarball":"http://registry-npm.ywwl.com/xdg-basedir/download/xdg-basedir-5.0.0.tgz","fileCount":5,"unpackedSize":6359,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgasDUCRA9TVsSAnZWagAAy34P/1guhc4TjVsZUqw+elfA\nSTctTJwpBlxgIg0QZ3NgYNlgbFuucpQcyUxWxyoXLi1JKfTIESZEUHZXGZjV\ndklbVecwvu/UpnGzmpUlMfpFT2VyOL4Ln8lYaZHPIuoFI44yi99HY79sRbQ4\n4Hzdxhd9sAEyNmqdrOZmtB8jNYEXIrmop0dX2jDiEGmSN8KbSz6uMi9p/cOe\neeYpmjAN0Jj3Z3Z0M4BvFqJ7+rMyj3sFCTE7wm2bDQguqlPHpUpd3Ud4fJjq\n4srcg3+WUafGkEbyt87IdRRjek3YhEst3NmWuLlrhPmCv1TEo6gHjhUOvGZD\n0Cri1PVO9sIC/65oBPPqtlOoQgFt4zJqCy1XfyowDDXdgZLq05zb77Umw24m\nw36OzoxmUqrl/tTCAHhur4+ucvBA7DtTqLdEr3+ctm+Fvi13/esoLpB90WFq\nRBFr41TQKOXYGoxsmn6cfFcgzXvOHvd0cm4KM0Tqpkn4YV2wqc+Xpg1oO5Fj\nbkhYI7dbmix8duRnVtleLT5s4Ugg5v8goo/H1XXoeU9lEQl3mj81aynmxKK/\n162t7CoOEpKckY5a84HOjg5Dmh0OrqEuxu2j7o/K0i/qmeUYa/YSYXJVp9tK\neVQFJAqZLII4wX7vpa0t3Siw+DZLnmq/OJhSAN8ZjUtyqeeQt9XBYa/uCsrv\niv9D\r\n=onXP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMkNEKHc1YIgrPRBDg9HVJV9uU7rZbj7PjEuCzTdJscwIgYtLk1SFFPa04Bat3cnGdvHPvkYP5/B6vXJji+W26Q94="}],"size":2601,"noattachment":false,"key":"/xdg-basedir/-/xdg-basedir-5.0.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/xdg-basedir_5.0.0_1617608915772_0.6350504480753574"},"_hasShrinkwrap":false,"readme":"# xdg-basedir\n\n> Get [XDG Base Directory](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) paths\n\nThis 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.\n\n## Install\n\n```\n$ npm install xdg-basedir\n```\n\n## Usage\n\n```js\nimport {xdgData, xdgConfig, xdgDataDirectories} from 'xdg-basedir';\n\nconsole.log(xdgData);\n//=> '/home/sindresorhus/.local/share'\n\nconsole.log(xdgConfig);\n//=> '/home/sindresorhus/.config'\n\nconsole.log(xdgDataDirectories);\n//=> ['/home/sindresorhus/.local/share', '/usr/local/share/', '/usr/share/']\n```\n\n## API\n\nThe 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).\n\n### xdgData\n\nDirectory for user-specific data files.\n\n### xdgConfig\n\nDirectory for user-specific configuration files.\n\n### xdgState\n\nDirectory for user-specific state files.\n\n### xdgCache\n\nDirectory for user-specific non-essential data files.\n\n### xdgRuntime\n\nDirectory for user-specific non-essential runtime files and other file objects (such as sockets, named pipes, etc).\n\n### xdgDataDirectories\n\nPreference-ordered array of base directories to search for data files in addition to `xdgData`.\n\n### xdgConfigDirectories\n\nPreference-ordered array of base directories to search for configuration files in addition to `xdgConfig`.\n\n---\n\n<div align=\"center\">\n\t<b>\n\t\t<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>\n\t</b>\n\t<br>\n\t<sub>\n\t\tTidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.\n\t</sub>\n</div>\n","publish_time":1617608915908,"_cnpm_publish_time":1617608915908,"dist-tags":{"latest":"5.1.0"}}