Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/node-core-library > JsonFile > save

JsonFile.save() method

Saves the file to disk. Returns false if nothing was written due to options.onlyIfChanged.

Signature:

static save(jsonObject: JsonObject, jsonFilename: string, options?: IJsonFileSaveOptions): boolean;

Parameters

ParameterTypeDescription
jsonObjectJsonObjectthe object to be saved
jsonFilenamestringthe file path to write
optionsIJsonFileSaveOptions(Optional) other settings that control how the file is saved

Returns:

boolean

false if ISaveJsonFileOptions.onlyIfChanged didn't save anything; true otherwise