# appdata-path

> Get the AppData path

Latest version **1.0.0** (published 2018-09-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install appdata-path
pnpm add appdata-path
yarn add appdata-path
bun add appdata-path
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-09-03 |
| First published | 2017-06-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Maintainers | demurgos |
| Keywords | appdata, os, environment |

## Links

- npm: https://www.npmjs.com/package/appdata-path
- Repository: https://github.com/demurgos/appdata-path
- Issues: https://github.com/demurgos/appdata-path/issues
- npm.io page: https://npm.io/package/appdata-path

## 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

- 1.0.0 (latest) — 2018-09-03
- 0.1.2 — 2017-06-20
- 0.1.1 — 2017-06-17
- 0.1.0 — 2017-06-17

## README

# AppData Path

## Installation

```shell
npm install -S appdata-path
```

## Usage

```javascript
import getAppDataPath from "appdata-path";
// Or
// const getAppDataPath = require("appdata-path");

console.log(getAppDataPath());
/*
 * Linux:
 * "/home/demurgos/.config"
 * 
 * Mac:
 * "/Users/demurgos/Library/Application Support"
 * 
 * Windows:
 * "C:\Users\demurgos\AppData\Roaming"
 * 
 * System with custom `APPDATA` environment variable:
 * process.env["APPDATA"]
 * For example:
 * process.env["APPDATA"] = "/home/demurgos/apps"
 * => "/home/demurgos/apps"
 */

console.log(getAppDataPath("my-app"));
/*
 * Linux:
 * "/home/demurgos/.config/my-app"
 * 
 * Mac:
 * "/Users/demurgos/Library/Application Support/my-app"
 * 
 * Windows:
 * "C:\Users\demurgos\AppData\Roaming\my-app"
 * 
 * System with custom `APPDATA` environment variable:
 * path.join(process.env["APPDATA"], "my-app")
 * or (if `process.env["APPDATA"] === os.homedir()`)
 * path.join(process.env["APPDATA"], ".my-app")
 * For example:
 * process.env["APPDATA"] = "/home/demurgos/apps"
 * => "/home/demurgos/apps/my-app"
 * process.env["APPDATA"] = "/home/demurgos"
 * => "/home/demurgos/.my-app"
 */

```

## API

### `getAppDataPath(app?: string): string`

Returns the absolute system-dependant path for the place where applications
should store their data for the current user.
If you pass the name of your app directory or file as an argument,
it will return the absolute path for the place where you should store the
data of your application. It will prefix you file / directory name by a dot
if the AppData directory happens to also be the user's home, otherwise it
will just use it as is. See the examples above.

## Changelog

See [CHANGELOG.md](./CHANGELOG.md).

## License

See [LICENSE.md](./LICENSE.md).

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