Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ab014d4

Browse filesBrowse files
bzozMylesBorins
authored andcommitted
doc: make mkdtemp example work on Windows
PR-URL: #15408 Fixes: #14960 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 0b5798b commit ab014d4
Copy full SHA for ab014d4

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Open diff view settings
Collapse file

‎doc/api/fs.md‎

Copy file name to clipboardExpand all lines: doc/api/fs.md
+3-3Lines changed: 3 additions & 3 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1133,10 +1133,10 @@ object with an `encoding` property specifying the character encoding to use.
11331133
Example:
11341134

11351135
```js
1136-
fs.mkdtemp('/tmp/foo-', (err, folder) => {
1136+
fs.mkdtemp(path.join(os.tmpdir(), 'foo-'), (err, folder) => {
11371137
if (err) throw err;
11381138
console.log(folder);
1139-
// Prints: /tmp/foo-itXde2
1139+
// Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2
11401140
});
11411141
```
11421142

@@ -1148,7 +1148,7 @@ the `prefix` *must* end with a trailing platform-specific path separator
11481148

11491149
```js
11501150
// The parent directory for the new temporary directory
1151-
const tmpDir = '/tmp';
1151+
const tmpDir = os.tmpdir();
11521152

11531153
// This method is *INCORRECT*:
11541154
fs.mkdtemp(tmpDir, (err, folder) => {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.