From ad3a583bc45fceb8d2f08160b7c10727e9a891c9 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sun, 1 Oct 2023 21:59:52 -0400 Subject: [PATCH 1/2] fs: add flush option to writeFile() functions This commit adds a 'flush' option to the fs.writeFile family of functions. Refs: https://github.com/nodejs/node/issues/49886 --- doc/api/fs.md | 18 +++- lib/fs.js | 59 +++++++++-- lib/internal/fs/promises.js | 31 +++++- test/parallel/test-fs-write-file-flush.js | 114 ++++++++++++++++++++++ 4 files changed, 209 insertions(+), 13 deletions(-) create mode 100644 test/parallel/test-fs-write-file-flush.js diff --git a/doc/api/fs.md b/doc/api/fs.md index 34d10418b2acc8..7d170613a7baf8 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1742,6 +1742,9 @@ All the [caveats][] for `fs.watch()` also apply to `fsPromises.watch()`.