index.js
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));
}
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));
}
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 ) ) ; }
Writes a JSON file
@param {string} file Name of the output file (.json extension will be added)
@param {string} json The JSON variable
Writes a JSON file