Skip to content

Instantly share code, notes, and snippets.

@mizner
Created March 11, 2018 11:31
Show Gist options
  • Select an option

  • Save mizner/2d2879d65ffb0bd08086e51507a548e1 to your computer and use it in GitHub Desktop.

Select an option

Save mizner/2d2879d65ffb0bd08086e51507a548e1 to your computer and use it in GitHub Desktop.
Node write to JSON Example
fs.readFile(
'./config.json',
(err, data) => {
let json = JSON.parse(data);
json.externalURL = bs.utils.devIp.shift();
fs.writeFile('./config.json', JSON.stringify(json), err => {
if (err) {
throw err;
}
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment