Skip to content

Commit 16cad4d

Browse files
authored
Merge pull request #279 from raszi/266-change-readmemd-reference-of-graceful-cleanup
Fix #266
2 parents 4c2d3f2 + d766aef commit 16cad4d

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

README.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ npm install tmp
6060

6161
Please also check [API docs][4].
6262

63+
## Graceful cleanup
64+
65+
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.
66+
67+
To enforce this, you can call the `setGracefulCleanup()` method:
68+
69+
```javascript
70+
const tmp = require('tmp');
71+
72+
tmp.setGracefulCleanup();
73+
```
74+
6375
### Asynchronous file creation
6476

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

322-
## Graceful cleanup
323-
324-
If graceful cleanup is set, tmp will remove all controlled temporary objects on process exit, otherwise the
325-
temporary objects will remain in place, waiting to be cleaned up on system restart or otherwise scheduled temporary
326-
object removal.
327-
328-
To enforce this, you can call the `setGracefulCleanup()` method:
329-
330-
```javascript
331-
const tmp = require('tmp');
332-
333-
tmp.setGracefulCleanup();
334-
```
335-
336334
## Options
337335

338336
All options are optional :)

0 commit comments

Comments
 (0)