Big update!Introducing GitHub Bot Commands. Learn more
Socket
BlogLoveLog in
Book a demo

xdg-basedir

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Issues
File Explorer

Advanced tools

xdg-basedir

Get XDG Base Directory paths

    5.1.0latest

Version published
Maintainers
1
Weekly downloads
10,092,592
increased by1.69%

Weekly downloads

Changelog

Source

  • Add support for XDG_STATE_HOME (#6) 2bbd2ce

https://github.com/sindresorhus/xdg-basedir/compare/v5.0.1...v5.1.0

Readme

Source

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.


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Keywords

FAQs

What is xdg-basedir?

Get XDG Base Directory paths

Is xdg-basedir popular?

The npm package xdg-basedir receives a total of 9,675,580 weekly downloads. As such, xdg-basedir popularity was classified as popular.

Is xdg-basedir well maintained?

We found that xdg-basedir demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 05 Aug 2021
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc