mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
doc: use await in filehandle.truncate() snippet
The example snippet of filehandle.close() uses the `await` keyword based on convention. This change updates the example snippet of filehandle.truncate() to similarly use the keyword for the purposes of consistency. PR-URL: https://github.com/nodejs/node/pull/38939 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
This commit is contained in:
1 parent
e7f3f0d778
commit
f799c4617e
1 file changed
+1
-1
+1
-1
@@ -394,7 +394,7 @@ try {
|
||||
filehandle = await open('temp.txt', 'r+');
|
||||
await filehandle.truncate(4);
|
||||
} finally {
|
||||
filehandle?.close();
|
||||
await filehandle?.close();
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in new issue
Block a user