File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -330,6 +330,18 @@ changes:
330
330
Returns the operating system's default directory for temporary files as a
331
331
string.
332
332
333
+ By default on macOS, the returned path is a symlink. To get the resolved path,
334
+ use [ ` fs.realpath() ` ] [ ] or [ ` fs.realpathSync() ` ] [ ] .
335
+
336
+ ``` js
337
+ const tmpdirPath = os .tmpdir ();
338
+
339
+ // For most use cases, it does not matter whether tmpdirPath is a symlink or not
340
+ // but if it does matter, obtain a resolved path with fs.realpath() or
341
+ // fs.realpathSync().
342
+ const tmpdirResolvedPath = fs .realpathSync (tmpdirPath);
343
+ ```
344
+
333
345
## ` os.totalmem() `
334
346
<!-- YAML
335
347
added: v0.3.3
@@ -1252,6 +1264,8 @@ The following process scheduling constants are exported by
1252
1264
</table >
1253
1265
1254
1266
[ `SystemError` ] : errors.html#errors_class_systemerror
1267
+ [ `fs.realpath()` ] : fs.html#fs_fs_realpath_path_options_callback
1268
+ [ `fs.realpathSync()` ] : fs.html#fs_fs_realpathsync_path_options
1255
1269
[ `process.arch` ] : process.html#process_process_arch
1256
1270
[ `process.platform` ] : process.html#process_process_platform
1257
1271
[ Android building ] : https://github.com/nodejs/node/blob/master/BUILDING.md#androidandroid-based-devices-eg-firefox-os
You can’t perform that action at this time.
0 commit comments