adspace


How will you truncate a file using node?

Answer Posted / Swati

To truncate (clear) a file in Node.js, you can use the `fs.truncate()` method:n```javascriptnfs.truncate('file_path', 0, function(err){...});```

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is node js losing popularity?

589


How we can read a file in node js?

568