Skip to content

Commit

Permalink
Merge pull request #279 from raszi/266-change-readmemd-reference-of-g…
Browse files Browse the repository at this point in the history
…raceful-cleanup

Fix #266
  • Loading branch information
silkentrance committed Aug 26, 2022
2 parents 4c2d3f2 + d766aef commit 16cad4d
Showing 1 changed file with 12 additions and 14 deletions.
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

0 comments on commit 16cad4d

Please sign in to comment.