Menu BAR

FEEL FREE TO ASK ANY PROGRAM and please mention any error if you find it

14 Nov 2022

Node JS program to delete a text file

 ## Node JS program to delete a text file ##


var fs = require ('fs');


fs.unlink ('file.txt', function (err){
    if (err) throw err;

    console.log (' File deleted successfully!! ');
});


===OUTPUT===

Run the program using the node command:
$ node deleteFile.js
File deleted successfully!! 

No comments:

Post a Comment