Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/glynnbird/tmpdir
- Owner: glynnbird
- Created: 2021-02-05T16:16:15.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-02-05T16:17:30.000Z (almost 4 years ago)
- Last Synced: 2024-10-12T22:13:03.642Z (about 1 month ago)
- Language: JavaScript
- Size: 20.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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()
```