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:
RA80533 authored and Michaël Zasso committed 2021-06-11 07:25:02 +02:00
1 parent 5218fe86d1
commit 405b50cdba
1 file changed
+1 -1
+1 -1
View File
@@ -402,7 +402,7 @@ try {
filehandle = await open('temp.txt', 'r+');
await filehandle.truncate(4);
} finally {
filehandle?.close();
await filehandle?.close();
}
```