code: function writeJSON(file, json){
  	var s = file.split(".");
  	if (s.length > 0) {
  		var ext = s[s.length - 1];
  		if (ext != "json"){
  			file = file + ".json";
  		}
  	}
    fs.writeFileSync(file, JSON.stringify(json));
  }
docs: Writes a JSON file
  @param {string} file Name of the output file (.json extension will be added)
  @param {string} json The JSON variable