Asynchronously append data to a file, creating the file if it does not yet exist. data can be a string or a Buffer.
data
Buffer
If options is a string, then it specifies the encoding.
options
encoding
The mode option only affects the newly created file. See fs.open() for more details.
mode
fs.open()
The path may be specified as a FileHandle that has been opened for appending (using fsPromises.open()).
path
FileHandle
fsPromises.open()
v10.0.0
Fulfills with undefined upon success.
undefined
filename or {FileHandle}
Optional
Asynchronously append data to a file, creating the file if it does not yet exist.
datacan be a string or aBuffer.If
optionsis a string, then it specifies theencoding.The
modeoption only affects the newly created file. Seefs.open()for more details.The
pathmay be specified as aFileHandlethat has been opened for appending (usingfsPromises.open()).Since
v10.0.0
Returns
Fulfills with
undefinedupon success.