code: function writeContractsFile(contractsFilePath, contractsObject, callback) { // eslint-disable-line
    if (typeof contractsFilePath !== 'string') {
      return callback();
    }
  
    if (utils.filenameExtension(contractsFilePath) !== 'json') {
      throw new Error('Your contracts output file must be a JSON file (i.e. --output ./contracts.json)');
    }
  
    fs.writeFile(path.resolve(contractsFilePath), JSON.stringify(contractsObject), (writeContractsFileError) => {
      if (writeContractsFileError) {
        throw new Error(`while writting output JSON file ${contractsFilePath}: ${writeContractsFileError}`);
      }
  
      callback();
    });
  }
docs: write contracts file