Path to the JSON5 file.
Data to be stringified and written to the file.
Optionaloptions: {Options for writing the file and stringifying JSON5.
OptionalcharsetEncoding?: stringThe character set encoding of the file.
Defaults to "utf-8".
OptionalendOfLine?: "\n" | "\r\n" | nullThe line ending style of the file.
If null, the stringifier default is used.
Defaults to null.
OptionalfinalNewline?: boolean | nullWhether the file should end with a newline.
If null, the stringifier default is used.
Defaults to null.
Optionalflag?: OpenModeOptionalflush?: booleanIf all data is successfully written to the file, and flush
is true, filehandle.sync() is used to flush the data.
Optionalindentation?: stringThe indentation string of the JSON file.
Defaults to an empty string (no indentation).
Optionalmode?: ModeOptionalquoteStyle?: "'" | "\""The quote style to use when writing the JSON5 file.
Defaults to double quotes (").
Optionalreplacer?: JsonReplacerA function that alters the behavior of the stringification process.
See MDN for more information.
Optionalsignal?: AbortSignal | nullWhen provided the corresponding AbortController can be used to cancel an asynchronous action.
OptionaltrimTrailingWhitespace?: boolean | nullWhether to trim trailing whitespace when writing the file.
If null, the stringifier default is used.
Defaults to null.
A promise that resolves when the file has been written.
Writes a JSON5 file by stringifying the provided data.