File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1536,10 +1536,10 @@ object with an `encoding` property specifying the character encoding to use.
1536
1536
Example:
1537
1537
1538
1538
```js
1539
- fs.mkdtemp('/tmp/ foo-', (err, folder) => {
1539
+ fs.mkdtemp(path.join(os.tmpdir(), ' foo-') , (err, folder) => {
1540
1540
if (err) throw err;
1541
1541
console.log(folder);
1542
- // Prints: /tmp/foo-itXde2
1542
+ // Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2
1543
1543
});
1544
1544
```
1545
1545
@@ -1551,7 +1551,7 @@ the `prefix` *must* end with a trailing platform-specific path separator
1551
1551
1552
1552
```js
1553
1553
// The parent directory for the new temporary directory
1554
- const tmpDir = '/tmp' ;
1554
+ const tmpDir = os.tmpdir() ;
1555
1555
1556
1556
// This method is *INCORRECT*:
1557
1557
fs.mkdtemp(tmpDir, (err, folder) => {
You can’t perform that action at this time.
0 commit comments