Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ npm install tmp

Please also check [API docs][4].

## Graceful cleanup

If graceful cleanup is set, tmp will remove all controlled temporary objects on process exit, otherwise the temporary objects will remain in place, waiting to be cleaned up on system restart or otherwise scheduled temporary object removal.

To enforce this, you can call the `setGracefulCleanup()` method:

```javascript
const tmp = require('tmp');

tmp.setGracefulCleanup();
```

### Asynchronous file creation

Simple temporary file creation, the file will be closed and unlinked on process exit.
Expand Down Expand Up @@ -319,20 +331,6 @@ const tmpname = tmp.tmpNameSync(options);
console.log('Created temporary filename: ', tmpname);
```

## Graceful cleanup

If graceful cleanup is set, tmp will remove all controlled temporary objects on process exit, otherwise the
temporary objects will remain in place, waiting to be cleaned up on system restart or otherwise scheduled temporary
object removal.

To enforce this, you can call the `setGracefulCleanup()` method:

```javascript
const tmp = require('tmp');

tmp.setGracefulCleanup();
```

## Options

All options are optional :)
Expand Down