mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
doc: make mkdtemp example work on Windows
PR-URL: https://github.com/nodejs/node/pull/15408 Fixes: https://github.com/nodejs/node/issues/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>
This commit is contained in:
1 parent
0b5798b3c3
commit
ab014d4056
1 file changed
+3
-3
+3
-3
@@ -1133,10 +1133,10 @@ object with an `encoding` property specifying the character encoding to use.
|
||||
Example:
|
||||
|
||||
```js
|
||||
fs.mkdtemp('/tmp/foo-', (err, folder) => {
|
||||
fs.mkdtemp(path.join(os.tmpdir(), 'foo-'), (err, folder) => {
|
||||
if (err) throw err;
|
||||
console.log(folder);
|
||||
// Prints: /tmp/foo-itXde2
|
||||
// Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2
|
||||
});
|
||||
```
|
||||
|
||||
@@ -1148,7 +1148,7 @@ the `prefix` *must* end with a trailing platform-specific path separator
|
||||
|
||||
```js
|
||||
// The parent directory for the new temporary directory
|
||||
const tmpDir = '/tmp';
|
||||
const tmpDir = os.tmpdir();
|
||||
|
||||
// This method is *INCORRECT*:
|
||||
fs.mkdtemp(tmpDir, (err, folder) => {
|
||||
|
||||
Reference in new issue
Block a user