@@ -730,6 +730,7 @@ of the file.
730730An example using the ` buffer` option with a pre-allocated buffer:
731731
732732` ` ` mjs
733+ import { Buffer } from ' node:buffer' ;
733734import { open } from ' node:fs/promises' ;
734735
735736const file = await open (' ./some/file/to/read' );
@@ -745,6 +746,7 @@ try {
745746An example using the ` buffer` option with a function returning a buffer:
746747
747748` ` ` mjs
749+ import { Buffer } from ' node:buffer' ;
748750import { open } from ' node:fs/promises' ;
749751
750752const file = await open (' ./some/file/to/read' );
@@ -1902,6 +1904,7 @@ Any specified {FileHandle} has to support reading.
19021904An example using the `buffer` option with a pre-allocated buffer:
19031905
19041906```mjs
1907+ import { Buffer } from 'node:buffer';
19051908import { readFile } from 'node:fs/promises';
19061909
19071910const buf = Buffer.alloc(16384);
@@ -1912,6 +1915,7 @@ console.log(contents); // A view over `buf` containing only the bytes read
19121915An example using the `buffer` option with a function returning a buffer:
19131916
19141917```mjs
1918+ import { Buffer } from 'node:buffer';
19151919import { readFile } from 'node:fs/promises';
19161920
19171921const contents = await readFile('/path/to/file', {
@@ -4420,6 +4424,7 @@ system requests but rather the internal buffering `fs.readFile` performs.
44204424An example using the ` buffer` option with a pre-allocated buffer:
44214425
44224426` ` ` mjs
4427+ import { Buffer } from ' node:buffer' ;
44234428import { readFile } from ' node:fs' ;
44244429
44254430const buf = Buffer .alloc (16384 );
@@ -4432,6 +4437,7 @@ readFile('/path/to/file', { buffer: buf }, (err, data) => {
44324437An example using the ` buffer` option with a function returning a buffer:
44334438
44344439` ` ` mjs
4440+ import { Buffer } from ' node:buffer' ;
44354441import { readFile } from ' node:fs' ;
44364442
44374443readFile (' /path/to/file' , {
0 commit comments