Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Sosnowski <bartosz@janeasystems.com>2017-09-14 15:26:42 +0300
committerJames M Snell <jasnell@gmail.com>2017-09-20 17:56:27 +0300
commitacb0d012b303c734c47c5ea9e758132181187703 (patch)
tree9e9bbc04dd7b1ca2f10181b9d7acaa4386cc8844 /doc/api/fs.md
parentbdfed1ad254556cfc18ae86e3193bbb6046d2124 (diff)
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>
Diffstat (limited to 'doc/api/fs.md')
-rw-r--r--doc/api/fs.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/api/fs.md b/doc/api/fs.md
index 0d9755d6090..034817b8b3b 100644
--- a/doc/api/fs.md
+++ b/doc/api/fs.md
@@ -1536,10 +1536,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
});
```
@@ -1551,7 +1551,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) => {