# quick-temp

> Create and remove temporary directories with minimal effort

Latest version **0.1.9** (published 2025-11-24) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 45/100 (D)** — status: stable.

Positive: no vulnerabilities.

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

## Facts

| | |
|---|---|
| Version | 0.1.9 |
| Published | 2025-11-24 |
| First published | 2014-02-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 7.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Jo Liss |
| Maintainers | joliss, rwjblue, stefanpenner |

## Links

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

## Dependencies (3)

- [mktemp](https://npm.io/package/mktemp.md) ^2.0.1
- [rimraf](https://npm.io/package/rimraf.md) ^5.0.10
- [underscore.string](https://npm.io/package/underscore.string.md) ~3.3.6

## Recent versions

- 0.1.9 (latest) — 2025-11-24
- 0.1.8 — 2017-02-14
- 0.1.7 — 2017-02-14
- 0.1.6 — 2016-08-27
- 0.1.5 — 2015-11-25
- 0.1.4 — 2015-11-25
- 0.1.3 — 2015-07-14
- 0.1.2 — 2014-04-25
- 0.1.1 — 2014-04-01
- 0.1.0 — 2014-02-24
- 0.0.2 — 2014-02-10
- 0.0.1 — 2014-02-10

## README

# node-quick-temp

Create and remove temporary directories. Useful for build tools, like Broccoli
plugins. Smart about naming, and placing them in `./tmp` if possible, so you
don't have to worry about this.

## Installation

```bash
npm install --save quick-temp
```

## Usage

```js
var quickTemp = require('quick-temp');
```

### Creating a temporary directory

To make a temporary and assign its path to `this.tmpDestDir`, call either one
of these:

```js
quickTemp.makeOrRemake(this, 'tmpDestDir');
// or
quickTemp.makeOrReuse(this, 'tmpDestDir');
```

If `this.tmpDestDir` already contains a path, `makeOrRemake` will remove it
first and then create a new directory, whereas `makeOrReuse` will be a no-op.

Both functions also return the path of the temporary directory.

An optional third argument lets you override the class-name component of the
temporary directory name:

```js
quickTemp.makeOrRemake(this, 'tmpDestDir', 'TreeMerger');
quickTemp.makeOrRemake(this, 'tmpDestDir', this.constructor.name); // default
```

### Removing a temporary directory

To remove a previously-created temporary directory and all its contents, call

```js
quickTemp.remove(this, 'tmpDestDir');
```

This will also assign `this.tmpDestDir = null`. If `this.tmpDestDir` is
already null or undefined, it will be a no-op.

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