1.1.3 • Published 6 years ago

temp-filesystem v1.1.3

Weekly downloads
6
License
MIT
Repository
github
Last release
6 years ago

TempFileSystem

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

Installing TempFileSystem

TempFileSystem can be installed using the npm-cli:

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

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();
1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago