Synchronous version of writeJsonFile. Writes an object to a file as JSON.
writeJsonFile
The type of the object to write.
The absolute path of the file to write.
The object to serialize and write.
A VoidIOResult indicating success or failure.
VoidIOResult
writeJsonFile for the async version.
1.1.0
const config = { name: 'app', version: 1 };writeJsonFileSync('/config.json', config); Copy
const config = { name: 'app', version: 1 };writeJsonFileSync('/config.json', config);
Synchronous version of
writeJsonFile. Writes an object to a file as JSON.