I am writing a JSON file using NodeJS, like this:
var path = "D:\\test.json"
var writeContent = {"Success" : "This is a sample"}
fs.writeFile(path, JSON.stringify(writeContent, null, 4), function (error) {
if (error === null) {
response.json(SuccessResponse);
}else{
response.json(ErrorResponse + error.message);
}
});
The file is getting written successfully, and also the JSON file is pretty printed when I open the JSON file in latest file editors such as Subllime3, Notepad++ I am able to view the pretty form of the file. But when I open the same file in Notepad, I am not able to view the content in the pretty format.
It is viewed as:
{ "GlobalName": "CIRCULAR_GRATES_M01_METRIC", "LocalName": "Circular Grates M01" }