Home > @rushstack/node-core-library > IJsonFileSaveOptions

IJsonFileSaveOptions interface

Options for JsonFile.saveJsonFile()


export interface IJsonFileSaveOptions extends IJsonFileStringifyOptions 

Extends: IJsonFileStringifyOptions


Property Type Description
ensureFolderExists? boolean (Optional) Creates the folder recursively using FileSystem.ensureFolder() Defaults to false.
onlyIfChanged? boolean (Optional) If there is an existing file, and the contents have not changed, then don’t write anything; this preserves the old timestamp.
updateExistingFile? boolean (Optional) If true, use the “jju” library to preserve the existing JSON formatting: The file will be loaded from the target filename, the new content will be merged in (preserving whitespace and comments), and then the file will be overwritten with the merged contents. If the target file does not exist, then the file is saved normally.