# node-standardpaths

> Receive common operating system standard paths in JavaScript and Node

Latest version **0.0.1** (published 2016-10-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-standardpaths
pnpm add node-standardpaths
yarn add node-standardpaths
bun add node-standardpaths
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2016-10-05 |
| First published | 2016-10-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | GhettoGirl |
| Maintainers | ghettogirl |
| Keywords | standardpaths, standardpath, standard paths, standard path, default paths, default path, config location, default location, xdg |

## Links

- npm: https://www.npmjs.com/package/node-standardpaths
- Homepage: https://github.com/GhettoGirl/node-standardpaths
- Issues: https://github.com/GhettoGirl/node-standardpaths/issues
- npm.io page: https://npm.io/package/node-standardpaths

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.0.1 (latest) — 2016-10-05

## README

# node-standardpaths

This project is an attempt to bring [QStandardPaths](http://doc.qt.io/qt-5/qstandardpaths.html) from the Qt Project to JavaScript and Node to get common platform-specific standard paths.

This includes paths like
 - the **configuration directories** used to store system and user configuration files,
 - **data directories**,
 - **cache directories**,
 - and several others. (see the QStandardPaths documentation for the planned paths)

Targeted platforms are all which Node supports, which are
 - Linux, FreeBSD and Solaris [*XDG Base Directory Specification*]
 - Darwin (Mac OS X, macOS)
 - Windows


#### Supported Paths

At the moment this library can report the following paths.

| Type                    | Description                                         |
| ----------------------- | --------------------------------------------------- |
| HomePath                | Users home path                                     |
| ConfigLocation          | Users configuration directory                       |
| SystemConfigLocation    | Global configuration directory                      |


### Unresolved Paths

Besides of getting the mentioned paths above, this library has the possibility to report any of the above paths in unresolved form, which means instead of a valid path you get the path with environment variables (for example `$HOME` instead of `/home/user`). The unresolved paths will never contain non-existent environment variables (for example if `$XDG_CONFIG_HOME` isn't set or empty, `$HOME/.config` will be returned instead).


## Usage


Example code snippet
```js
var standardpaths = require('node-standardpaths');

standardpaths.path(standardpaths.HomePath);
standardpaths.path(standardpaths.HomePath, false);

// returns the following
// on Linux, FreeBSD, Solaris: '/home/user', '$HOME'
// on Darwin:                  '/Users/user', '$HOME'
// on Windows:                 'C:\Users\user' '%USERPROFILE%'
```

**ATTENTION:** the API is in the progress of being changed, please be aware of that.

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