Skip to content

Commit

Permalink
fix #266: move paragraph on graceful cleanup to the head of the docum…
Browse files Browse the repository at this point in the history
…entation
  • Loading branch information
silkentrance committed Aug 26, 2022
1 parent 4c2d3f2 commit d766aef
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 d766aef

Please sign in to comment.