mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -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
5218fe86d1
commit
405b50cdba
1 file changed
+1
-1
+1
-1
@@ -402,7 +402,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