Created
January 20, 2017 01:21
-
-
Save gyandeeps/bf55eb56cdd6a93d002b8f4e85b56967 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require("chai").assert; | |
var sampleObject = { | |
a: 1, | |
b: 2, | |
c: { | |
x: 11, | |
y: 22 | |
} | |
}; | |
fs.writeFile("./object.json", JSON.stringify(sampleObject, null, 4), (err) => { | |
if (err) { | |
console.error(err); | |
return; | |
}; | |
console.log("File has been created"); | |
}); | |
/* | |
Content of the file: | |
{ | |
a: 1, | |
b: 2, | |
c: { | |
x: 11, | |
y: 22 | |
} | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment