# tmp-sync

> The sync version of tmp just for test cases, making it much easier.

Latest version **1.1.2** (published 2017-03-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install tmp-sync
pnpm add tmp-sync
yarn add tmp-sync
bun add tmp-sync
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2017-03-27 |
| First published | 2014-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.8.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | kael |
| Maintainers | kael |
| Keywords | tmp-sync, temporary, tmp, temp, tempdir, tempfile, tmpdir, tmpfile |

## Links

- npm: https://www.npmjs.com/package/tmp-sync
- Repository: https://github.com/kaelzhang/node-tmp-sync
- Homepage: https://github.com/kaelzhang/node-tmp-sync#readme
- Issues: https://github.com/kaelzhang/node-tmp-sync/issues
- npm.io page: https://npm.io/package/tmp-sync

## Dependencies (2)

- [osenv](https://npm.io/package/osenv.md) ^0.1.0
- [fs-sync](https://npm.io/package/fs-sync.md) ^1.0.4

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 1.1.2 (latest) — 2017-03-27
- 1.1.1 — 2017-03-27
- 1.1.0 — 2015-08-14
- 1.0.1 — 2014-05-17
- 1.0.0 — 2014-05-17
- 0.1.2 — 2014-05-17
- 0.1.1 — 2014-05-17
- 0.1.0 — 2014-05-17

## README

# tmp-sync [![NPM version](https://badge.fury.io/js/tmp-sync.svg)](http://badge.fury.io/js/tmp-sync) [![Build Status](https://travis-ci.org/kaelzhang/node-tmp-sync.svg?branch=master)](https://travis-ci.org/kaelzhang/node-tmp-sync) [![Dependency Status](https://gemnasium.com/kaelzhang/node-tmp-sync.svg)](https://gemnasium.com/kaelzhang/node-tmp-sync)

The sync version of tmp just for test cases, making our life it much easier.

## Why?

I got tired of write asynchronous codes of [`tmp`](http://www.npmjs.org/package/tmp) even just in test cases.

Only use this package in your test cases, not in production environment for you should always using asynchronous fs.

## Usage

```js
var tmp = require('tmp-sync');
```

### tmp.in([root])

- **root** `path=` the root path for the temp directory (optional, default to OS tmp directory)

Makes a temp dir inside `root` and returns the newly created dir. The dir will be automatically `tmp.mark()`ed.

### tmp.mark(dir)

- **dir** `path` the path of a directory

Marks a dir, and the dir will be removed when the current process exits.

### tmp.clean()

Cleans all marked tmp dirs. Most usually you need not to call this method manually.

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