Serialize data to JSON and write it to a file.
Path to the output file
Data to serialize and write
A promise that resolves when the file is written.
Overwrites the file if it already exists.
Serialize data to JSON and write it to a file.