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 @@ -1133,10 +1133,10 @@ object with an `encoding` property specifying the character encoding to use.
1133
1133
Example:
1134
1134
1135
1135
``` js
1136
- fs .mkdtemp (' /tmp/ foo-' , (err , folder ) => {
1136
+ fs .mkdtemp (path . join ( os . tmpdir (), ' foo-' ) , (err , folder ) => {
1137
1137
if (err) throw err;
1138
1138
console .log (folder);
1139
- // Prints: /tmp/foo-itXde2
1139
+ // Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2
1140
1140
});
1141
1141
```
1142
1142
@@ -1148,7 +1148,7 @@ the `prefix` *must* end with a trailing platform-specific path separator
1148
1148
1149
1149
``` js
1150
1150
// The parent directory for the new temporary directory
1151
- const tmpDir = ' /tmp ' ;
1151
+ const tmpDir = os . tmpdir () ;
1152
1152
1153
1153
// This method is *INCORRECT*:
1154
1154
fs .mkdtemp (tmpDir, (err , folder ) => {
You can’t perform that action at this time.
0 commit comments