File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -312,15 +312,15 @@ Use of this function is encouraged for relevant regression tests and for new
312
312
APIs that work with user-provided objects.
313
313
314
314
``` mjs
315
- import { promises as fs } from ' node:fs' ;
315
+ import { open } from ' node:fs/promises ' ;
316
316
import { mustNotMutate } from ' ../common/index.mjs' ;
317
317
318
318
const _mutableOptions = { length: 4 , position: 8 };
319
319
const options = mustNotMutate (_mutableOptions);
320
320
321
- // In filehandle.read or filehandle.write attempt to mutate options will throw
321
+ // In filehandle.read or filehandle.write, attempt to mutate options will throw
322
322
// In the test code, options can still be mutated via _mutableOptions
323
- const fh = await fs . open (' /path/to/file' , ' r+' );
323
+ const fh = await open (' /path/to/file' , ' r+' );
324
324
const { buffer } = await fh .read (options);
325
325
_mutableOptions .position = 4 ;
326
326
await fh .write (buffer, options);
You can’t perform that action at this time.
0 commit comments