Home > @microsoft/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: Object, jsonFilename: string, options?: IJsonFileSaveOptions): boolean;

Parameters

Parameter Type Description
jsonObject Object the object to be saved
jsonFilename string the file path to write
options IJsonFileSaveOptions other settings that control how the file is saved

Returns:

boolean

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