Search This Blog

2023/05/04

How to delete all content of file

 var fs = require('fs');

fs.truncate('./myfile.txt', 0, function() {
console.log('File Content Deleted')
});

No comments:

Post a Comment