Answers for "create a file with node js"

3

fs create or edit file

//Edit file or creates if doesnt exist
 const fs = require('fs');
 fs.appendFile(‘<fileName>’,<content>,callbackFunction)
Posted by: Guest on April-01-2020
0

writefile in node js

// append_file.js

const fs = require('fs');

// add a line to a lyric file, using appendFile
fs.appendFile('empirestate.txt', '\nRight there up on Broadway', (err) => {
    if (err) throw err;
    console.log('The lyrics were updated!');
});
Posted by: Guest on March-15-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language