Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/glynnbird/tmpdir

Temporary directory creator and destroyer
https://github.com/glynnbird/tmpdir

Last synced: 5 days ago
JSON representation

Temporary directory creator and destroyer

Awesome Lists containing this project

README

        

# tmpdir

Creates and deletes temporary directories.

## Installation

```sh
npm install --save https://github.com/glynnbird/tmpdir
```

## Usage

```js
const tmpdir = require('tmpdir')
const path = require('path')
const fs = require('fs')

// make temporary directory
const tempPath = tmpdir.createTmpDirectory()

// write some temporary files
const p = path.join(tempPath, 'myfile.txt')
fs.writeFileSync(p, 'Hello World')

// tidy up
tmpdir.removeTmpDirectory()
```