# xdg-env

> Provide the XDG env variables normalized

Latest version **0.0.3** (published 2014-08-06) · 0 weekly downloads

## Install

```sh
npm install xdg-env
pnpm add xdg-env
yarn add xdg-env
bun add xdg-env
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2014-08-06 |
| First published | 2014-08-06 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Maintainers | rawiroaisen |
| Keywords | freedesktop, xdg, env, linux |

## Links

- npm: https://www.npmjs.com/package/xdg-env
- Repository: git@github.com:rawiroaisen/node-xdg-env
- Homepage: https://github.com/rawiroaisen/node-xdg-env
- Issues: https://github.com/rawiroaisen/node-xdg-env/issues
- npm.io page: https://npm.io/package/xdg-env

## Alternatives

- [replicas-cli](https://npm.io/package/replicas-cli.md) — 3.0K weekly downloads
- [env-contract](https://npm.io/package/env-contract.md) — 133 weekly downloads
- [@openveo/api](https://npm.io/package/@openveo/api.md) — 61 weekly downloads
- [@ryniaubenpm2/cumque-error-reiciendis](https://npm.io/package/@ryniaubenpm2/cumque-error-reiciendis.md) — 54 weekly downloads
- [ts-global-type-extra](https://npm.io/package/ts-global-type-extra.md) — 11 weekly downloads

## Recent versions

- 0.0.3 (latest) — 2014-08-06
- 0.0.2 — 2014-08-06
- 0.0.1 — 2014-08-06

## README

# Node XDG-ENV
<br><br>
Provide an Object with the XDG_* env variables or their defaults (according to http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html)
<br><br>

Arrays are the env strings (or defaults) splitted by ':'
<br>
$* means process.env.*

## Install
```
npm install xdg-env
```

## Example
```js
var env = require('xdg-env')

console.log(env)

// logs

{
	DATA_HOME: "/home/user/.local/share",
	
	CONFIG_HOME: "/home/user/.config",
	
	DATA_DIRS: [ // first DATA_DIR is always DATA_HOME
		"/home/user/.local/share",
		"/usr/share/pantheon",
		"/usr/share/gnome",
		"/usr/local/share/",
		"/usr/share/"
	],
	
	CONFIG_DIRS: [
		"/etc/xdg/xdg-pantheon",
		"/etc/xdg"
	],
	
	CACHE_HOME: "/home/user/.cache",
	
	CURRENT_DESKTOP: [
		"Pantheon" // Could by GNOME, KDE, Unity, etc. and more than one name
	],
	
	USER_DIRS: { // dirs defined in $CONFIG_HOME/user-dirs.dirs
		DOWNLOAD: "/home/user/Descargas",
		TEMPLATES: "/home/user/Plantillas",
		PUBLICSHARE: "/home/user/Público",
		DOCUMENTS: "/home/user/Documentos",
		MUSIC: "/home/user/Música",
		PICTURES: "/home/user/Imágenes",
		VIDEOS: "/home/user/Vídeos",
		DESKTOP: "/home/user/Escritorio"
	}
}
```

---
_Source: https://npm.io/package/xdg-env · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
