# temp-dir

> Get the real path of the system temp directory

Latest version **3.0.0** (published 2022-09-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install temp-dir
pnpm add temp-dir
yarn add temp-dir
bun add temp-dir
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2022-09-26 |
| First published | 2017-03-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=14.16 |
| Dependencies | 0 |
| Unpacked size | 3.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 85 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | temp, tmpdir, os, system, real, path, realpath, resolved, temporary, directory, folder |

## Links

- npm: https://www.npmjs.com/package/temp-dir
- Repository: https://github.com/sindresorhus/temp-dir
- Homepage: https://github.com/sindresorhus/temp-dir#readme
- Issues: https://github.com/sindresorhus/temp-dir/issues
- npm.io page: https://npm.io/package/temp-dir

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

- 3.0.0 (latest) — 2022-09-26
- 2.0.0 — 2019-04-28
- 1.0.0 — 2017-03-28

## README

# temp-dir

> Get the real path of the system temp directory

[The `os.tmpdir()` built-in doesn't return the real path.](https://github.com/nodejs/node/issues/11422) That can cause problems when the returned path is a symlink, which is the case on macOS. Use this module to get the resolved path.

## Install

```sh
npm install temp-dir
```

## Usage

```js
import temporaryDirectory from 'temp-dir';

console.log(temporaryDirectory);
//=> '/private/var/folders/3x/jf5977fn79jbglr7rk0tq4d00000gn/T'
```

```js
import os from 'node:os';

console.log(os.tmpdir());
//=> '/var/folders/3x/jf5977fn79jbglr7rk0tq4d00000gn/T' // <= Symlink
```

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