# home-or-tmp

> Get the user home directory with fallback to the system temp directory

Latest version **4.0.0** (published 2021-04-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install home-or-tmp
pnpm add home-or-tmp
yarn add home-or-tmp
bun add home-or-tmp
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2021-04-16 |
| First published | 2015-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 2.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 30 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | user, home, homedir, directory, folder, path, tmp, temp, temporary, fallback, graceful |

## Links

- npm: https://www.npmjs.com/package/home-or-tmp
- Repository: https://github.com/sindresorhus/home-or-tmp
- Homepage: https://github.com/sindresorhus/home-or-tmp#readme
- Issues: https://github.com/sindresorhus/home-or-tmp/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/home-or-tmp

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

- 4.0.0 (latest) — 2021-04-16
- 3.0.0 — 2017-01-21
- 2.0.0 — 2015-06-13
- 1.0.0 — 2015-05-17

## README

# home-or-tmp

> Get the user home directory with fallback to the system temp directory

Useful in cases where the home directory either isn't set or doesn't exist.

## Install

```
$ npm install home-or-tmp
```

## Usage

```js
import homeOrTemp from 'home-or-tmp';

console.log(homeOrTemp);
//=> '/Users/sindresorhus'

// And if there is no home directory:

console.log(homeOrTemp);
//=> '/var/folders/m3/5574nnhn0yj488ccryqr7tc80000gn/T'
```

---

<div align="center">
	<b>
		<a href="https://tidelift.com/subscription/pkg/npm-home-or-tmp?utm_source=npm-home-or-tmp&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
	</b>
	<br>
	<sub>
		Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
	</sub>
</div>

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