# temp-filesystem

> Provides the functionality to handle temporary files and directories the object-oriented way.

Latest version **1.1.3** (published 2019-08-05) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

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

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2019-08-05 |
| First published | 2018-11-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 10.9 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Manuel Thalmann |
| Maintainers | manuth |

## Links

- npm: https://www.npmjs.com/package/temp-filesystem
- Repository: https://github.com/manuth/TempFileSystem
- Homepage: https://github.com/manuth/TempFileSystem#readme
- Issues: https://github.com/manuth/TempFileSystem/issues
- npm.io page: https://npm.io/package/temp-filesystem

## Dependencies (3)

- [tmp](https://npm.io/package/tmp.md) 0.1.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^8.1.0
- [@types/tmp](https://npm.io/package/@types/tmp.md) 0.1.0

## Recent versions

- 1.1.3 (latest) — 2019-08-05
- 1.1.2 — 2019-06-16
- 1.1.1 — 2019-01-05
- 1.1.0 — 2018-11-20
- 1.0.1 — 2018-11-10
- 1.0.0 — 2018-11-10

## README

# TempFileSystem
Provides the functionality to handle temporary files and directories the object-oriented way.

## Installing TempFileSystem
`TempFileSystem` can be installed using the `npm`-cli:
```bash
npm install --save temp-filesystem
```

## Using TempFileSystem
You can create temporary filesystem-entries by initializing new instances of the `TempFile`- or the `TempDirectory`-class.  
Temporary filesystem-entries easily can be removed by invoking `TempFileSystem.Dispose()`.

When working with a `TempDirectory` you can use `TempDirectory.MakePath(...string[])` to create paths relative to the directory.

### Example
```ts
import fs = require("fs");
import { TempDirectory, TempFile } from "temp-filesystem";

let tempDir = new TempDirectory();
let tempFile = new TempFile(
    {
        postfix: ".json"
    });

let fileName = tempDir.MakePath("this", "is", "a", "test.txt");
fs.writeFileSync(fileName, "Hello World");
fs.writeFileSync(tempFile.FullName, '{ "Message": "Hello World" }');

tempFile.Dispose();
tempDir.Dispose();
```

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