Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

writefile in node js

// append_file.js

const fs = require('fs');

// add a line to a lyric file, using appendFile
fs.appendFile('empirestate.txt', '
Right there up on Broadway', (err) => {
    if (err) throw err;
    console.log('The lyrics were updated!');
});
Source by stackabuse.com #
 
PREVIOUS NEXT
Tagged: #writefile #node #js
ADD COMMENT
Topic
Name
3+5 =