# path-temp

> Returns a unique temp file name inside the specified folder

Latest version **3.0.0** (published 2026-03-11) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 65/100 (B)** — status: stable.

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2026-03-11 |
| First published | 2018-02-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22.13 |
| Dependencies | 1 |
| Unpacked size | 2.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 104 |
| Author | Zoltan Kochan <z@kochan.io> (https://www.kochan.io/) |
| Maintainers | zkochan |
| Keywords | path, temp, unique |

## Links

- npm: https://www.npmjs.com/package/path-temp
- Repository: https://github.com/zkochan/packages/tree/main/path-temp
- Homepage: https://github.com/zkochan/packages/tree/main/path-temp#readme
- npm.io page: https://npm.io/package/path-temp

## Dependencies (1)

- [unique-string](https://npm.io/package/unique-string.md) ^3.0.0

## 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) — 2026-03-11
- 2.1.1 — 2026-02-09
- 2.1.0 — 2023-07-16
- 2.0.0 — 2019-05-04
- 1.0.0 — 2018-02-09

## README

# path-temp

> Returns a unique temp file name inside the specified folder

<!--@shields('npm')-->
[![npm version](https://img.shields.io/npm/v/path-temp.svg)](https://www.npmjs.com/package/path-temp)
<!--/@-->

Useful when there's a need to do atomic operations. The temp name contains the
process ID.

## Installation

```sh
<npm|yarn|pnpm> add path-temp
```

## Usage

```js
const pathTemp = require('path-temp')

console.log(pathTemp(process.cwd()))
//> "/home/zkochan/src/path-temp/_tmp_17230_cf3396bb9fddb8ebb30807366facf123"
```

## License

[MIT](./LICENSE) © [Zoltan Kochan](https://www.kochan.io/)

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