I want to delete the content of a simple text file with node.js. Or replace the file with a new/empty one.
How can I achieve this in node?
fs.unlink is the call you need to delete a file. To replace it with different contents, just overwrite it with fs.writeFile.
fs.writeFile