fs create or edit file

JavaScript
//Edit file or creates if doesnt exist
 const fs = require('fs');
 fs.appendFile(‘<fileName>’,<content>,callbackFunction)
Source

Also in JavaScript: