Created
January 20, 2017 01:20
-
-
Save gyandeeps/151ef0a81d81214371a3fc628423b6a3 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), (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