FileHandle

The object fs/promises open() returns for an open file, wrapping its file descriptor with promise-based read, write and close methods.

In more detail

It lets you read or write at chosen positions without loading the whole file. Always close it, ideally in a finally block or with await using, because waiting for garbage collection to close it is unreliable.

Related terms

Taught in

References