Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -8563,13 +8563,20 @@ Close the stream gracefully, flushing the internal buffer before closing.
* `callback` {Function}
* `err` {Error|null} An error if the flush failed, otherwise `null`.

Writes the current buffer to the file if a write was not in progress. Do
nothing if `minLength` is zero or if it is already writing.
Writes the current buffer to the file. The callback is invoked after pending
writes complete and, unless the `fsync` option is enabled, after the data has
been synchronized with `fs.fsync()`. `fsync` errors indicating that the file
descriptor does not support synchronization (for example, a pipe or a TTY)
are ignored.

#### `utf8Stream.flushSync()`

Flushes the buffered data synchronously. This is a costly operation.

If an asynchronous write is in flight when `flushSync()` is called, only the
data queued after it is written, and it may reach the file before the data
of the in-flight write.

#### `utf8Stream.fsync`

* {boolean} Whether the stream is performing a `fs.fsyncSync()` after every
Expand Down
Loading
Loading