filename or FileHandle
A JavaScript value, usually an object or array, to be converted.
Optional
options: BufferEncoding | ObjectEncodingOptions & { Optional
replacer: Replacer<any>A function that transforms the results.
Optional
space: string | numberAdds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
Converts a JavaScript value to a JavaScript Object Notation (JSON) string, and asynchronously writes data to a file, replacing the file if it already exists.