File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,25 @@ added: v15.4.0
175175The ` 'close' ` event is emitted when the {FileHandle} has been closed and can no
176176longer be used.
177177
178+ #### ` FileHandle.isFileHandle(value) `
179+
180+ <!-- YAML
181+ added: v22.0.0
182+ -->
183+
184+ * ` value ` {any} The value to test.
185+ * Returns: {boolean} ` true ` if the given value is a {FileHandle}, ` false ` otherwise.
186+
187+ Returns ` true ` if the given value is a {FileHandle} instance.
188+
189+ ``` mjs
190+ import { open , FileHandle } from ' node:fs/promises' ;
191+
192+ const filehandle = await open (' thefile.txt' , ' r' );
193+ console .log (FileHandle .isFileHandle (filehandle)); // true
194+ console .log (FileHandle .isFileHandle ({})); // false
195+ ```
196+
178197#### ` filehandle.appendFile(data[, options]) `
179198
180199<!-- YAML
You can’t perform that action at this time.
0 commit comments