well this is my code
var miJson = JSON.stringify(miArray)
;
but I need all the data of the variable "miJson" to be in a file with the extension .json
well this is my code
var miJson = JSON.stringify(miArray)
;
but I need all the data of the variable "miJson" to be in a file with the extension .json
You can create files using the File System API
For example:
var fs = require('fs');
var file = 'miJson.json';
var data = JSON.stringify(miArray);
fs.writeFile(file, data, function(err) {
if(err) {
return console.log(err);
}
console.log("El archivo se guardo con exito!");
});